Current section
8 Versions
Jump to
Current section
8 Versions
Compare versions
13
files changed
+809
additions
-53
deletions
| @@ -212,4 +212,4 @@ | |
| 212 212 | {<<"optional">>,true}, |
| 213 213 | {<<"repository">>,<<"hexpm">>}, |
| 214 214 | {<<"requirement">>,<<"~> 1.0">>}]]}. |
| 215 | - {<<"version">>,<<"0.12.1">>}. |
| 215 | + {<<"version">>,<<"0.12.3">>}. |
| @@ -18,6 +18,10 @@ defmodule NomadClient.Api.Agent do | |
| 18 18 | - connection (NomadClient.Connection): Connection to server |
| 19 19 | - node (String.t): the name of the node |
| 20 20 | - opts (KeywordList): [optional] Optional parameters |
| 21 | + - :namespace (String.t): |
| 22 | + - :region (String.t): Make a request across regions to the given region |
| 23 | + - :index (integer()): index used for blocking requests |
| 24 | + - :wait (String.t): wait time used for blocking requests |
| 21 25 | ## Returns |
| 22 26 | |
| 23 27 | {:ok, nil} on success |
| @@ -25,11 +29,19 @@ defmodule NomadClient.Api.Agent do | |
| 25 29 | """ |
| 26 30 | @spec force_leave(Tesla.Env.client(), String.t(), keyword()) :: |
| 27 31 | {:ok, nil} | {:error, Tesla.Env.t()} |
| 28 | - def force_leave(connection, node, _opts \\ []) do |
| 32 | + def force_leave(connection, node, opts \\ []) do |
| 33 | + optional_params = %{ |
| 34 | + :namespace => :query, |
| 35 | + :region => :query, |
| 36 | + :index => :query, |
| 37 | + :wait => :query |
| 38 | + } |
| 39 | + |
| 29 40 | %{} |
| 30 41 | |> method(:post) |
| 31 42 | |> url("/agent/force-leave") |
| 32 43 | |> add_param(:query, :node, node) |
| 44 | + |> add_optional_params(optional_params, opts) |
| 33 45 | |> ensure_body() |
| 34 46 | |> Enum.into([]) |
| 35 47 | |> (&Connection.request(connection, &1)).() |
| @@ -45,6 +57,10 @@ defmodule NomadClient.Api.Agent do | |
| 45 57 | |
| 46 58 | - connection (NomadClient.Connection): Connection to server |
| 47 59 | - opts (KeywordList): [optional] Optional parameters |
| 60 | + - :namespace (String.t): |
| 61 | + - :region (String.t): Make a request across regions to the given region |
| 62 | + - :index (integer()): index used for blocking requests |
| 63 | + - :wait (String.t): wait time used for blocking requests |
| 48 64 | ## Returns |
| 49 65 | |
| 50 66 | {:ok, NomadClient.Model.AgentHealthResponse.t} on success |
| @@ -52,10 +68,18 @@ defmodule NomadClient.Api.Agent do | |
| 52 68 | """ |
| 53 69 | @spec get_health(Tesla.Env.client(), keyword()) :: |
| 54 70 | {:ok, NomadClient.Model.AgentHealthResponse.t()} | {:error, Tesla.Env.t()} |
| 55 | - def get_health(connection, _opts \\ []) do |
| 71 | + def get_health(connection, opts \\ []) do |
| 72 | + optional_params = %{ |
| 73 | + :namespace => :query, |
| 74 | + :region => :query, |
| 75 | + :index => :query, |
| 76 | + :wait => :query |
| 77 | + } |
| 78 | + |
| 56 79 | %{} |
| 57 80 | |> method(:get) |
| 58 81 | |> url("/agent/health") |
| 82 | + |> add_optional_params(optional_params, opts) |
| 59 83 | |> Enum.into([]) |
| 60 84 | |> (&Connection.request(connection, &1)).() |
| 61 85 | |> evaluate_response([ |
| @@ -70,6 +94,10 @@ defmodule NomadClient.Api.Agent do | |
| 70 94 | |
| 71 95 | - connection (NomadClient.Connection): Connection to server |
| 72 96 | - opts (KeywordList): [optional] Optional parameters |
| 97 | + - :namespace (String.t): |
| 98 | + - :region (String.t): Make a request across regions to the given region |
| 99 | + - :index (integer()): index used for blocking requests |
| 100 | + - :wait (String.t): wait time used for blocking requests |
| 73 101 | ## Returns |
| 74 102 | |
| 75 103 | {:ok, NomadClient.Model.ServerMembers.t} on success |
| @@ -77,10 +105,18 @@ defmodule NomadClient.Api.Agent do | |
| 77 105 | """ |
| 78 106 | @spec get_members(Tesla.Env.client(), keyword()) :: |
| 79 107 | {:ok, NomadClient.Model.ServerMembers.t()} | {:error, Tesla.Env.t()} |
| 80 | - def get_members(connection, _opts \\ []) do |
| 108 | + def get_members(connection, opts \\ []) do |
| 109 | + optional_params = %{ |
| 110 | + :namespace => :query, |
| 111 | + :region => :query, |
| 112 | + :index => :query, |
| 113 | + :wait => :query |
| 114 | + } |
| 115 | + |
| 81 116 | %{} |
| 82 117 | |> method(:get) |
| 83 118 | |> url("/agent/members") |
| 119 | + |> add_optional_params(optional_params, opts) |
| 84 120 | |> Enum.into([]) |
| 85 121 | |> (&Connection.request(connection, &1)).() |
| 86 122 | |> evaluate_response([ |
| @@ -95,6 +131,10 @@ defmodule NomadClient.Api.Agent do | |
| 95 131 | |
| 96 132 | - connection (NomadClient.Connection): Connection to server |
| 97 133 | - opts (KeywordList): [optional] Optional parameters |
| 134 | + - :namespace (String.t): |
| 135 | + - :region (String.t): Make a request across regions to the given region |
| 136 | + - :index (integer()): index used for blocking requests |
| 137 | + - :wait (String.t): wait time used for blocking requests |
| 98 138 | ## Returns |
| 99 139 | |
| 100 140 | {:ok, NomadClient.Model.AgentSelf.t} on success |
| @@ -102,10 +142,18 @@ defmodule NomadClient.Api.Agent do | |
| 102 142 | """ |
| 103 143 | @spec get_self(Tesla.Env.client(), keyword()) :: |
| 104 144 | {:ok, NomadClient.Model.AgentSelf.t()} | {:error, Tesla.Env.t()} |
| 105 | - def get_self(connection, _opts \\ []) do |
| 145 | + def get_self(connection, opts \\ []) do |
| 146 | + optional_params = %{ |
| 147 | + :namespace => :query, |
| 148 | + :region => :query, |
| 149 | + :index => :query, |
| 150 | + :wait => :query |
| 151 | + } |
| 152 | + |
| 106 153 | %{} |
| 107 154 | |> method(:get) |
| 108 155 | |> url("/agent/self") |
| 156 | + |> add_optional_params(optional_params, opts) |
| 109 157 | |> Enum.into([]) |
| 110 158 | |> (&Connection.request(connection, &1)).() |
| 111 159 | |> evaluate_response([ |
| @@ -146,6 +194,10 @@ defmodule NomadClient.Api.Agent do | |
| 146 194 | - connection (NomadClient.Connection): Connection to server |
| 147 195 | - address ([String.t]): server address (ip:port) |
| 148 196 | - opts (KeywordList): [optional] Optional parameters |
| 197 | + - :namespace (String.t): |
| 198 | + - :region (String.t): Make a request across regions to the given region |
| 199 | + - :index (integer()): index used for blocking requests |
| 200 | + - :wait (String.t): wait time used for blocking requests |
| 149 201 | ## Returns |
| 150 202 | |
| 151 203 | {:ok, NomadClient.Model.JoinResponse.t} on success |
| @@ -153,11 +205,19 @@ defmodule NomadClient.Api.Agent do | |
| 153 205 | """ |
| 154 206 | @spec join(Tesla.Env.client(), list(String.t()), keyword()) :: |
| 155 207 | {:ok, NomadClient.Model.JoinResponse.t()} | {:error, Tesla.Env.t()} |
| 156 | - def join(connection, address, _opts \\ []) do |
| 208 | + def join(connection, address, opts \\ []) do |
| 209 | + optional_params = %{ |
| 210 | + :namespace => :query, |
| 211 | + :region => :query, |
| 212 | + :index => :query, |
| 213 | + :wait => :query |
| 214 | + } |
| 215 | + |
| 157 216 | %{} |
| 158 217 | |> method(:post) |
| 159 218 | |> url("/agent/join") |
| 160 219 | |> add_param(:query, :address, address) |
| 220 | + |> add_optional_params(optional_params, opts) |
| 161 221 | |> ensure_body() |
| 162 222 | |> Enum.into([]) |
| 163 223 | |> (&Connection.request(connection, &1)).() |
| @@ -173,6 +233,10 @@ defmodule NomadClient.Api.Agent do | |
| 173 233 | |
| 174 234 | - connection (NomadClient.Connection): Connection to server |
| 175 235 | - opts (KeywordList): [optional] Optional parameters |
| 236 | + - :namespace (String.t): |
| 237 | + - :region (String.t): Make a request across regions to the given region |
| 238 | + - :index (integer()): index used for blocking requests |
| 239 | + - :wait (String.t): wait time used for blocking requests |
| 176 240 | - :log_level (String.t): log level |
| 177 241 | - :node_id (String.t): node id |
| 178 242 | - :server_id (String.t): server id |
| @@ -187,6 +251,10 @@ defmodule NomadClient.Api.Agent do | |
| 187 251 | {:ok, NomadClient.Model.StreamFrame.t()} | {:error, Tesla.Env.t()} |
| 188 252 | def stream_logs(connection, opts \\ []) do |
| 189 253 | optional_params = %{ |
| 254 | + :namespace => :query, |
| 255 | + :region => :query, |
| 256 | + :index => :query, |
| 257 | + :wait => :query, |
| 190 258 | :log_level => :query, |
| 191 259 | :node_id => :query, |
| 192 260 | :server_id => :query, |
| @@ -213,6 +281,10 @@ defmodule NomadClient.Api.Agent do | |
| 213 281 | - connection (NomadClient.Connection): Connection to server |
| 214 282 | - address ([String.t]): server address (ip:port) |
| 215 283 | - opts (KeywordList): [optional] Optional parameters |
| 284 | + - :namespace (String.t): |
| 285 | + - :region (String.t): Make a request across regions to the given region |
| 286 | + - :index (integer()): index used for blocking requests |
| 287 | + - :wait (String.t): wait time used for blocking requests |
| 216 288 | ## Returns |
| 217 289 | |
| 218 290 | {:ok, [%String{}, ...]} on success |
| @@ -220,11 +292,19 @@ defmodule NomadClient.Api.Agent do | |
| 220 292 | """ |
| 221 293 | @spec update_servers(Tesla.Env.client(), list(String.t()), keyword()) :: |
| 222 294 | {:ok, list(String.t())} | {:error, Tesla.Env.t()} |
| 223 | - def update_servers(connection, address, _opts \\ []) do |
| 295 | + def update_servers(connection, address, opts \\ []) do |
| 296 | + optional_params = %{ |
| 297 | + :namespace => :query, |
| 298 | + :region => :query, |
| 299 | + :index => :query, |
| 300 | + :wait => :query |
| 301 | + } |
| 302 | + |
| 224 303 | %{} |
| 225 304 | |> method(:post) |
| 226 305 | |> url("/agent/servers") |
| 227 306 | |> add_param(:query, :address, address) |
| 307 | + |> add_optional_params(optional_params, opts) |
| 228 308 | |> ensure_body() |
| 229 309 | |> Enum.into([]) |
| 230 310 | |> (&Connection.request(connection, &1)).() |
| @@ -18,6 +18,10 @@ defmodule NomadClient.Api.Allocations do | |
| 18 18 | - connection (NomadClient.Connection): Connection to server |
| 19 19 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 20 20 | - opts (KeywordList): [optional] Optional parameters |
| 21 | + - :namespace (String.t): |
| 22 | + - :region (String.t): Make a request across regions to the given region |
| 23 | + - :index (integer()): index used for blocking requests |
| 24 | + - :wait (String.t): wait time used for blocking requests |
| 21 25 | ## Returns |
| 22 26 | |
| 23 27 | {:ok, NomadClient.Model.Allocation.t} on success |
| @@ -25,10 +29,18 @@ defmodule NomadClient.Api.Allocations do | |
| 25 29 | """ |
| 26 30 | @spec get_allocation(Tesla.Env.client(), String.t(), keyword()) :: |
| 27 31 | {:ok, NomadClient.Model.Allocation.t()} | {:error, Tesla.Env.t()} |
| 28 | - def get_allocation(connection, alloc_id, _opts \\ []) do |
| 32 | + def get_allocation(connection, alloc_id, opts \\ []) do |
| 33 | + optional_params = %{ |
| 34 | + :namespace => :query, |
| 35 | + :region => :query, |
| 36 | + :index => :query, |
| 37 | + :wait => :query |
| 38 | + } |
| 39 | + |
| 29 40 | %{} |
| 30 41 | |> method(:get) |
| 31 42 | |> url("/allocation/#{alloc_id}") |
| 43 | + |> add_optional_params(optional_params, opts) |
| 32 44 | |> Enum.into([]) |
| 33 45 | |> (&Connection.request(connection, &1)).() |
| 34 46 | |> evaluate_response([ |
| @@ -43,6 +55,10 @@ defmodule NomadClient.Api.Allocations do | |
| 43 55 | |
| 44 56 | - connection (NomadClient.Connection): Connection to server |
| 45 57 | - opts (KeywordList): [optional] Optional parameters |
| 58 | + - :namespace (String.t): |
| 59 | + - :region (String.t): Make a request across regions to the given region |
| 60 | + - :index (integer()): index used for blocking requests |
| 61 | + - :wait (String.t): wait time used for blocking requests |
| 46 62 | - :prefix (String.t): Specifies a string to filter jobs on based on an index prefix. This is specified as a query string parameter |
| 47 63 | ## Returns |
| 48 64 | |
| @@ -53,6 +69,10 @@ defmodule NomadClient.Api.Allocations do | |
| 53 69 | {:ok, list(NomadClient.Model.AllocationListStub.t())} | {:error, Tesla.Env.t()} |
| 54 70 | def get_allocations(connection, opts \\ []) do |
| 55 71 | optional_params = %{ |
| 72 | + :namespace => :query, |
| 73 | + :region => :query, |
| 74 | + :index => :query, |
| 75 | + :wait => :query, |
| 56 76 | :prefix => :query |
| 57 77 | } |
| 58 78 | |
| @@ -76,6 +96,10 @@ defmodule NomadClient.Api.Allocations do | |
| 76 96 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 77 97 | - allocation_restart_request (AllocationRestartRequest): |
| 78 98 | - opts (KeywordList): [optional] Optional parameters |
| 99 | + - :namespace (String.t): |
| 100 | + - :region (String.t): Make a request across regions to the given region |
| 101 | + - :index (integer()): index used for blocking requests |
| 102 | + - :wait (String.t): wait time used for blocking requests |
| 79 103 | ## Returns |
| 80 104 | |
| 81 105 | {:ok, nil} on success |
| @@ -87,11 +111,19 @@ defmodule NomadClient.Api.Allocations do | |
| 87 111 | NomadClient.Model.AllocationRestartRequest.t(), |
| 88 112 | keyword() |
| 89 113 | ) :: {:ok, nil} | {:error, Tesla.Env.t()} |
| 90 | - def restart_allocation(connection, alloc_id, allocation_restart_request, _opts \\ []) do |
| 114 | + def restart_allocation(connection, alloc_id, allocation_restart_request, opts \\ []) do |
| 115 | + optional_params = %{ |
| 116 | + :namespace => :query, |
| 117 | + :region => :query, |
| 118 | + :index => :query, |
| 119 | + :wait => :query |
| 120 | + } |
| 121 | + |
| 91 122 | %{} |
| 92 123 | |> method(:post) |
| 93 124 | |> url("/allocation/#{alloc_id}/restart") |
| 94 125 | |> add_param(:body, :body, allocation_restart_request) |
| 126 | + |> add_optional_params(optional_params, opts) |
| 95 127 | |> Enum.into([]) |
| 96 128 | |> (&Connection.request(connection, &1)).() |
| 97 129 | |> evaluate_response([ |
| @@ -108,6 +140,10 @@ defmodule NomadClient.Api.Allocations do | |
| 108 140 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 109 141 | - alloc_signal_request (AllocSignalRequest): |
| 110 142 | - opts (KeywordList): [optional] Optional parameters |
| 143 | + - :namespace (String.t): |
| 144 | + - :region (String.t): Make a request across regions to the given region |
| 145 | + - :index (integer()): index used for blocking requests |
| 146 | + - :wait (String.t): wait time used for blocking requests |
| 111 147 | ## Returns |
| 112 148 | |
| 113 149 | {:ok, nil} on success |
| @@ -119,11 +155,19 @@ defmodule NomadClient.Api.Allocations do | |
| 119 155 | NomadClient.Model.AllocSignalRequest.t(), |
| 120 156 | keyword() |
| 121 157 | ) :: {:ok, nil} | {:error, Tesla.Env.t()} |
| 122 | - def signal_allocation(connection, alloc_id, alloc_signal_request, _opts \\ []) do |
| 158 | + def signal_allocation(connection, alloc_id, alloc_signal_request, opts \\ []) do |
| 159 | + optional_params = %{ |
| 160 | + :namespace => :query, |
| 161 | + :region => :query, |
| 162 | + :index => :query, |
| 163 | + :wait => :query |
| 164 | + } |
| 165 | + |
| 123 166 | %{} |
| 124 167 | |> method(:post) |
| 125 168 | |> url("/allocation/#{alloc_id}/signal") |
| 126 169 | |> add_param(:body, :body, alloc_signal_request) |
| 170 | + |> add_optional_params(optional_params, opts) |
| 127 171 | |> Enum.into([]) |
| 128 172 | |> (&Connection.request(connection, &1)).() |
| 129 173 | |> evaluate_response([ |
| @@ -139,6 +183,10 @@ defmodule NomadClient.Api.Allocations do | |
| 139 183 | - connection (NomadClient.Connection): Connection to server |
| 140 184 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 141 185 | - opts (KeywordList): [optional] Optional parameters |
| 186 | + - :namespace (String.t): |
| 187 | + - :region (String.t): Make a request across regions to the given region |
| 188 | + - :index (integer()): index used for blocking requests |
| 189 | + - :wait (String.t): wait time used for blocking requests |
| 142 190 | ## Returns |
| 143 191 | |
| 144 192 | {:ok, NomadClient.Model.AllocStopResponse.t} on success |
| @@ -146,10 +194,18 @@ defmodule NomadClient.Api.Allocations do | |
| 146 194 | """ |
| 147 195 | @spec stop_allocation(Tesla.Env.client(), String.t(), keyword()) :: |
| 148 196 | {:ok, NomadClient.Model.AllocStopResponse.t()} | {:error, Tesla.Env.t()} |
| 149 | - def stop_allocation(connection, alloc_id, _opts \\ []) do |
| 197 | + def stop_allocation(connection, alloc_id, opts \\ []) do |
| 198 | + optional_params = %{ |
| 199 | + :namespace => :query, |
| 200 | + :region => :query, |
| 201 | + :index => :query, |
| 202 | + :wait => :query |
| 203 | + } |
| 204 | + |
| 150 205 | %{} |
| 151 206 | |> method(:post) |
| 152 207 | |> url("/allocation/#{alloc_id}/stop") |
| 208 | + |> add_optional_params(optional_params, opts) |
| 153 209 | |> ensure_body() |
| 154 210 | |> Enum.into([]) |
| 155 211 | |> (&Connection.request(connection, &1)).() |
| @@ -18,6 +18,10 @@ defmodule NomadClient.Api.Client do | |
| 18 18 | - connection (NomadClient.Connection): Connection to server |
| 19 19 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 20 20 | - opts (KeywordList): [optional] Optional parameters |
| 21 | + - :namespace (String.t): |
| 22 | + - :region (String.t): Make a request across regions to the given region |
| 23 | + - :index (integer()): index used for blocking requests |
| 24 | + - :wait (String.t): wait time used for blocking requests |
| 21 25 | ## Returns |
| 22 26 | |
| 23 27 | {:ok, nil} on success |
| @@ -25,10 +29,18 @@ defmodule NomadClient.Api.Client do | |
| 25 29 | """ |
| 26 30 | @spec garbage_collect_allocation(Tesla.Env.client(), String.t(), keyword()) :: |
| 27 31 | {:ok, nil} | {:error, Tesla.Env.t()} |
| 28 | - def garbage_collect_allocation(connection, alloc_id, _opts \\ []) do |
| 32 | + def garbage_collect_allocation(connection, alloc_id, opts \\ []) do |
| 33 | + optional_params = %{ |
| 34 | + :namespace => :query, |
| 35 | + :region => :query, |
| 36 | + :index => :query, |
| 37 | + :wait => :query |
| 38 | + } |
| 39 | + |
| 29 40 | %{} |
| 30 41 | |> method(:get) |
| 31 42 | |> url("/client/allocation/#{alloc_id}/gc") |
| 43 | + |> add_optional_params(optional_params, opts) |
| 32 44 | |> Enum.into([]) |
| 33 45 | |> (&Connection.request(connection, &1)).() |
| 34 46 | |> evaluate_response([ |
| @@ -43,6 +55,10 @@ defmodule NomadClient.Api.Client do | |
| 43 55 | |
| 44 56 | - connection (NomadClient.Connection): Connection to server |
| 45 57 | - opts (KeywordList): [optional] Optional parameters |
| 58 | + - :namespace (String.t): |
| 59 | + - :region (String.t): Make a request across regions to the given region |
| 60 | + - :index (integer()): index used for blocking requests |
| 61 | + - :wait (String.t): wait time used for blocking requests |
| 46 62 | - :node_id (String.t): node id |
| 47 63 | ## Returns |
| 48 64 | |
| @@ -53,6 +69,10 @@ defmodule NomadClient.Api.Client do | |
| 53 69 | {:ok, nil} | {:error, Tesla.Env.t()} |
| 54 70 | def garbage_collect_allocation_0(connection, opts \\ []) do |
| 55 71 | optional_params = %{ |
| 72 | + :namespace => :query, |
| 73 | + :region => :query, |
| 74 | + :index => :query, |
| 75 | + :wait => :query, |
| 56 76 | :node_id => :query |
| 57 77 | } |
| 58 78 | |
| @@ -75,6 +95,10 @@ defmodule NomadClient.Api.Client do | |
| 75 95 | - connection (NomadClient.Connection): Connection to server |
| 76 96 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 77 97 | - opts (KeywordList): [optional] Optional parameters |
| 98 | + - :namespace (String.t): |
| 99 | + - :region (String.t): Make a request across regions to the given region |
| 100 | + - :index (integer()): index used for blocking requests |
| 101 | + - :wait (String.t): wait time used for blocking requests |
| 78 102 | ## Returns |
| 79 103 | |
| 80 104 | {:ok, NomadClient.Model.AllocResourceUsage.t} on success |
| @@ -82,10 +106,18 @@ defmodule NomadClient.Api.Client do | |
| 82 106 | """ |
| 83 107 | @spec get_client_allocation_stats(Tesla.Env.client(), String.t(), keyword()) :: |
| 84 108 | {:ok, NomadClient.Model.AllocResourceUsage.t()} | {:error, Tesla.Env.t()} |
| 85 | - def get_client_allocation_stats(connection, alloc_id, _opts \\ []) do |
| 109 | + def get_client_allocation_stats(connection, alloc_id, opts \\ []) do |
| 110 | + optional_params = %{ |
| 111 | + :namespace => :query, |
| 112 | + :region => :query, |
| 113 | + :index => :query, |
| 114 | + :wait => :query |
| 115 | + } |
| 116 | + |
| 86 117 | %{} |
| 87 118 | |> method(:get) |
| 88 119 | |> url("/client/allocation/#{alloc_id}/stats") |
| 120 | + |> add_optional_params(optional_params, opts) |
| 89 121 | |> Enum.into([]) |
| 90 122 | |> (&Connection.request(connection, &1)).() |
| 91 123 | |> evaluate_response([ |
| @@ -101,6 +133,10 @@ defmodule NomadClient.Api.Client do | |
| 101 133 | - connection (NomadClient.Connection): Connection to server |
| 102 134 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 103 135 | - opts (KeywordList): [optional] Optional parameters |
| 136 | + - :namespace (String.t): |
| 137 | + - :region (String.t): Make a request across regions to the given region |
| 138 | + - :index (integer()): index used for blocking requests |
| 139 | + - :wait (String.t): wait time used for blocking requests |
| 104 140 | - :path (String.t): Specifies the path of the file to read, relative to the root of the allocation directory |
| 105 141 | ## Returns |
| 106 142 | |
| @@ -111,6 +147,10 @@ defmodule NomadClient.Api.Client do | |
| 111 147 | {:ok, String.t()} | {:error, Tesla.Env.t()} |
| 112 148 | def get_client_file(connection, alloc_id, opts \\ []) do |
| 113 149 | optional_params = %{ |
| 150 | + :namespace => :query, |
| 151 | + :region => :query, |
| 152 | + :index => :query, |
| 153 | + :wait => :query, |
| 114 154 | :path => :query |
| 115 155 | } |
| 116 156 | |
| @@ -135,6 +175,10 @@ defmodule NomadClient.Api.Client do | |
| 135 175 | - offset (integer()): Specifies the byte offset from where content will be read |
| 136 176 | - limit (integer()): Specifies the number of bytes to read from the offset |
| 137 177 | - opts (KeywordList): [optional] Optional parameters |
| 178 | + - :namespace (String.t): |
| 179 | + - :region (String.t): Make a request across regions to the given region |
| 180 | + - :index (integer()): index used for blocking requests |
| 181 | + - :wait (String.t): wait time used for blocking requests |
| 138 182 | - :path (String.t): Specifies the path of the file to read, relative to the root of the allocation directory |
| 139 183 | ## Returns |
| 140 184 | |
| @@ -145,6 +189,10 @@ defmodule NomadClient.Api.Client do | |
| 145 189 | {:ok, String.t()} | {:error, Tesla.Env.t()} |
| 146 190 | def get_client_file_at_offest(connection, alloc_id, offset, limit, opts \\ []) do |
| 147 191 | optional_params = %{ |
| 192 | + :namespace => :query, |
| 193 | + :region => :query, |
| 194 | + :index => :query, |
| 195 | + :wait => :query, |
| 148 196 | :path => :query |
| 149 197 | } |
| 150 198 | |
| @@ -168,6 +216,10 @@ defmodule NomadClient.Api.Client do | |
| 168 216 | |
| 169 217 | - connection (NomadClient.Connection): Connection to server |
| 170 218 | - opts (KeywordList): [optional] Optional parameters |
| 219 | + - :namespace (String.t): |
| 220 | + - :region (String.t): Make a request across regions to the given region |
| 221 | + - :index (integer()): index used for blocking requests |
| 222 | + - :wait (String.t): wait time used for blocking requests |
| 171 223 | - :node_id (String.t): node id |
| 172 224 | ## Returns |
| 173 225 | |
| @@ -178,6 +230,10 @@ defmodule NomadClient.Api.Client do | |
| 178 230 | {:ok, list(NomadClient.Model.HostStats.t())} | {:error, Tesla.Env.t()} |
| 179 231 | def get_client_stats(connection, opts \\ []) do |
| 180 232 | optional_params = %{ |
| 233 | + :namespace => :query, |
| 234 | + :region => :query, |
| 235 | + :index => :query, |
| 236 | + :wait => :query, |
| 181 237 | :node_id => :query |
| 182 238 | } |
| 183 239 | |
| @@ -200,6 +256,10 @@ defmodule NomadClient.Api.Client do | |
| 200 256 | - connection (NomadClient.Connection): Connection to server |
| 201 257 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 202 258 | - opts (KeywordList): [optional] Optional parameters |
| 259 | + - :namespace (String.t): |
| 260 | + - :region (String.t): Make a request across regions to the given region |
| 261 | + - :index (integer()): index used for blocking requests |
| 262 | + - :wait (String.t): wait time used for blocking requests |
| 203 263 | - :path (String.t): Specifies the path of the file to read, relative to the root of the allocation directory |
| 204 264 | ## Returns |
| 205 265 | |
| @@ -210,6 +270,10 @@ defmodule NomadClient.Api.Client do | |
| 210 270 | {:ok, list(NomadClient.Model.AllocFileInfo.t())} | {:error, Tesla.Env.t()} |
| 211 271 | def list_client_files(connection, alloc_id, opts \\ []) do |
| 212 272 | optional_params = %{ |
| 273 | + :namespace => :query, |
| 274 | + :region => :query, |
| 275 | + :index => :query, |
| 276 | + :wait => :query, |
| 213 277 | :path => :query |
| 214 278 | } |
| 215 279 | |
| @@ -232,6 +296,10 @@ defmodule NomadClient.Api.Client do | |
| 232 296 | - connection (NomadClient.Connection): Connection to server |
| 233 297 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 234 298 | - opts (KeywordList): [optional] Optional parameters |
| 299 | + - :namespace (String.t): |
| 300 | + - :region (String.t): Make a request across regions to the given region |
| 301 | + - :index (integer()): index used for blocking requests |
| 302 | + - :wait (String.t): wait time used for blocking requests |
| 235 303 | - :path (String.t): Specifies the path of the file to read, relative to the root of the allocation directory |
| 236 304 | ## Returns |
| 237 305 | |
| @@ -242,6 +310,10 @@ defmodule NomadClient.Api.Client do | |
| 242 310 | {:ok, NomadClient.Model.AllocFileInfo.t()} | {:error, Tesla.Env.t()} |
| 243 311 | def stat_client_file(connection, alloc_id, opts \\ []) do |
| 244 312 | optional_params = %{ |
| 313 | + :namespace => :query, |
| 314 | + :region => :query, |
| 315 | + :index => :query, |
| 316 | + :wait => :query, |
| 245 317 | :path => :query |
| 246 318 | } |
| 247 319 | |
| @@ -265,6 +337,10 @@ defmodule NomadClient.Api.Client do | |
| 265 337 | - alloc_id (String.t): Specifies the UUID of the allocation. This must be the full UUID, not the short 8-character one |
| 266 338 | - offset (integer()): Specifies the byte offset from where content will be read |
| 267 339 | - opts (KeywordList): [optional] Optional parameters |
| 340 | + - :namespace (String.t): |
| 341 | + - :region (String.t): Make a request across regions to the given region |
| 342 | + - :index (integer()): index used for blocking requests |
| 343 | + - :wait (String.t): wait time used for blocking requests |
| 268 344 | - :path (String.t): Specifies the path of the file to read, relative to the root of the allocation directory |
| 269 345 | - :follow (boolean()): Specifies whether to tail the file |
| 270 346 | - :origin (String.t): Applies the relative offset to either the start or end of the file |
| @@ -277,6 +353,10 @@ defmodule NomadClient.Api.Client do | |
| 277 353 | {:ok, String.t()} | {:error, Tesla.Env.t()} |
| 278 354 | def stream_client_file(connection, alloc_id, offset, opts \\ []) do |
| 279 355 | optional_params = %{ |
| 356 | + :namespace => :query, |
| 357 | + :region => :query, |
| 358 | + :index => :query, |
| 359 | + :wait => :query, |
| 280 360 | :path => :query, |
| 281 361 | :follow => :query, |
| 282 362 | :origin => :query |
| @@ -304,6 +384,10 @@ defmodule NomadClient.Api.Client do | |
| 304 384 | - task (String.t): Specifies the name of the task inside the allocation to stream logs from |
| 305 385 | - offset (integer()): Specifies the byte offset from where content will be read |
| 306 386 | - opts (KeywordList): [optional] Optional parameters |
| 387 | + - :namespace (String.t): |
| 388 | + - :region (String.t): Make a request across regions to the given region |
| 389 | + - :index (integer()): index used for blocking requests |
| 390 | + - :wait (String.t): wait time used for blocking requests |
| 307 391 | - :follow (boolean()): Specifies whether to tail the file |
| 308 392 | - :type (String.t): Specifies the stream to stream |
| 309 393 | - :origin (String.t): Applies the relative offset to either the start or end of the file |
| @@ -317,6 +401,10 @@ defmodule NomadClient.Api.Client do | |
| 317 401 | {:ok, String.t()} | {:error, Tesla.Env.t()} |
| 318 402 | def stream_client_logs(connection, alloc_id, task, offset, opts \\ []) do |
| 319 403 | optional_params = %{ |
| 404 | + :namespace => :query, |
| 405 | + :region => :query, |
| 406 | + :index => :query, |
| 407 | + :wait => :query, |
| 320 408 | :follow => :query, |
| 321 409 | :type => :query, |
| 322 410 | :origin => :query, |
| @@ -18,6 +18,10 @@ defmodule NomadClient.Api.Deployments do | |
| 18 18 | - connection (NomadClient.Connection): Connection to server |
| 19 19 | - deployment_id (String.t): Specifies the UUID of the deployment. This must be the full UUID, not the short 8-character one. This is specified as part of the path |
| 20 20 | - opts (KeywordList): [optional] Optional parameters |
| 21 | + - :namespace (String.t): |
| 22 | + - :region (String.t): Make a request across regions to the given region |
| 23 | + - :index (integer()): index used for blocking requests |
| 24 | + - :wait (String.t): wait time used for blocking requests |
| 21 25 | ## Returns |
| 22 26 | |
| 23 27 | {:ok, NomadClient.Model.DeploymentUpdateResponse.t} on success |
| @@ -25,10 +29,18 @@ defmodule NomadClient.Api.Deployments do | |
| 25 29 | """ |
| 26 30 | @spec fail_deployment(Tesla.Env.client(), String.t(), keyword()) :: |
| 27 31 | {:ok, NomadClient.Model.DeploymentUpdateResponse.t()} | {:error, Tesla.Env.t()} |
| 28 | - def fail_deployment(connection, deployment_id, _opts \\ []) do |
| 32 | + def fail_deployment(connection, deployment_id, opts \\ []) do |
| 33 | + optional_params = %{ |
| 34 | + :namespace => :query, |
| 35 | + :region => :query, |
| 36 | + :index => :query, |
| 37 | + :wait => :query |
| 38 | + } |
| 39 | + |
| 29 40 | %{} |
| 30 41 | |> method(:post) |
| 31 42 | |> url("/deployment/fail/#{deployment_id}") |
| 43 | + |> add_optional_params(optional_params, opts) |
| 32 44 | |> ensure_body() |
| 33 45 | |> Enum.into([]) |
| 34 46 | |> (&Connection.request(connection, &1)).() |
| @@ -45,6 +57,10 @@ defmodule NomadClient.Api.Deployments do | |
| 45 57 | - connection (NomadClient.Connection): Connection to server |
| 46 58 | - deployment_id (String.t): Specifies the UUID of the deployment. This must be the full UUID, not the short 8-character one. This is specified as part of the path |
| 47 59 | - opts (KeywordList): [optional] Optional parameters |
| 60 | + - :namespace (String.t): |
| 61 | + - :region (String.t): Make a request across regions to the given region |
| 62 | + - :index (integer()): index used for blocking requests |
| 63 | + - :wait (String.t): wait time used for blocking requests |
| 48 64 | ## Returns |
| 49 65 | |
| 50 66 | {:ok, [%AllocationListStub{}, ...]} on success |
| @@ -52,10 +68,18 @@ defmodule NomadClient.Api.Deployments do | |
| 52 68 | """ |
| 53 69 | @spec get_allocations_for_deployment(Tesla.Env.client(), String.t(), keyword()) :: |
| 54 70 | {:ok, list(NomadClient.Model.AllocationListStub.t())} | {:error, Tesla.Env.t()} |
| 55 | - def get_allocations_for_deployment(connection, deployment_id, _opts \\ []) do |
| 71 | + def get_allocations_for_deployment(connection, deployment_id, opts \\ []) do |
| 72 | + optional_params = %{ |
| 73 | + :namespace => :query, |
| 74 | + :region => :query, |
| 75 | + :index => :query, |
| 76 | + :wait => :query |
| 77 | + } |
| 78 | + |
| 56 79 | %{} |
| 57 80 | |> method(:get) |
| 58 81 | |> url("/deployment/allocations/#{deployment_id}") |
| 82 | + |> add_optional_params(optional_params, opts) |
| 59 83 | |> Enum.into([]) |
| 60 84 | |> (&Connection.request(connection, &1)).() |
| 61 85 | |> evaluate_response([ |
| @@ -71,6 +95,10 @@ defmodule NomadClient.Api.Deployments do | |
| 71 95 | - connection (NomadClient.Connection): Connection to server |
| 72 96 | - deployment_id (String.t): Specifies the UUID of the deployment. This must be the full UUID, not the short 8-character one. This is specified as part of the path |
| 73 97 | - opts (KeywordList): [optional] Optional parameters |
| 98 | + - :namespace (String.t): |
| 99 | + - :region (String.t): Make a request across regions to the given region |
| 100 | + - :index (integer()): index used for blocking requests |
| 101 | + - :wait (String.t): wait time used for blocking requests |
| 74 102 | ## Returns |
| 75 103 | |
| 76 104 | {:ok, NomadClient.Model.Deployment.t} on success |
| @@ -78,10 +106,18 @@ defmodule NomadClient.Api.Deployments do | |
| 78 106 | """ |
| 79 107 | @spec get_deployment(Tesla.Env.client(), String.t(), keyword()) :: |
| 80 108 | {:ok, NomadClient.Model.Deployment.t()} | {:error, Tesla.Env.t()} |
| 81 | - def get_deployment(connection, deployment_id, _opts \\ []) do |
| 109 | + def get_deployment(connection, deployment_id, opts \\ []) do |
| 110 | + optional_params = %{ |
| 111 | + :namespace => :query, |
| 112 | + :region => :query, |
| 113 | + :index => :query, |
| 114 | + :wait => :query |
| 115 | + } |
| 116 | + |
| 82 117 | %{} |
| 83 118 | |> method(:get) |
| 84 119 | |> url("/deployment/#{deployment_id}") |
| 120 | + |> add_optional_params(optional_params, opts) |
| 85 121 | |> Enum.into([]) |
| 86 122 | |> (&Connection.request(connection, &1)).() |
| 87 123 | |> evaluate_response([ |
| @@ -96,6 +132,10 @@ defmodule NomadClient.Api.Deployments do | |
| 96 132 | |
| 97 133 | - connection (NomadClient.Connection): Connection to server |
| 98 134 | - opts (KeywordList): [optional] Optional parameters |
| 135 | + - :namespace (String.t): |
| 136 | + - :region (String.t): Make a request across regions to the given region |
| 137 | + - :index (integer()): index used for blocking requests |
| 138 | + - :wait (String.t): wait time used for blocking requests |
| 99 139 | - :prefix (String.t): Specifies a string to filter jobs on based on an index prefix. This is specified as a query string parameter |
| 100 140 | ## Returns |
| 101 141 | |
| @@ -106,6 +146,10 @@ defmodule NomadClient.Api.Deployments do | |
| 106 146 | {:ok, list(NomadClient.Model.Deployment.t())} | {:error, Tesla.Env.t()} |
| 107 147 | def get_deployments(connection, opts \\ []) do |
| 108 148 | optional_params = %{ |
| 149 | + :namespace => :query, |
| 150 | + :region => :query, |
| 151 | + :index => :query, |
| 152 | + :wait => :query, |
| 109 153 | :prefix => :query |
| 110 154 | } |
| 111 155 | |
| @@ -129,6 +173,10 @@ defmodule NomadClient.Api.Deployments do | |
| 129 173 | - deployment_id (String.t): Specifies the UUID of the deployment. This must be the full UUID, not the short 8-character one. This is specified as part of the path |
| 130 174 | - deployment_pause_request (DeploymentPauseRequest): |
| 131 175 | - opts (KeywordList): [optional] Optional parameters |
| 176 | + - :namespace (String.t): |
| 177 | + - :region (String.t): Make a request across regions to the given region |
| 178 | + - :index (integer()): index used for blocking requests |
| 179 | + - :wait (String.t): wait time used for blocking requests |
| 132 180 | ## Returns |
| 133 181 | |
| 134 182 | {:ok, NomadClient.Model.DeploymentUpdateResponse.t} on success |
| @@ -140,11 +188,19 @@ defmodule NomadClient.Api.Deployments do | |
| 140 188 | NomadClient.Model.DeploymentPauseRequest.t(), |
| 141 189 | keyword() |
| 142 190 | ) :: {:ok, NomadClient.Model.DeploymentUpdateResponse.t()} | {:error, Tesla.Env.t()} |
| 143 | - def pause_deployment(connection, deployment_id, deployment_pause_request, _opts \\ []) do |
| 191 | + def pause_deployment(connection, deployment_id, deployment_pause_request, opts \\ []) do |
| 192 | + optional_params = %{ |
| 193 | + :namespace => :query, |
| 194 | + :region => :query, |
| 195 | + :index => :query, |
| 196 | + :wait => :query |
| 197 | + } |
| 198 | + |
| 144 199 | %{} |
| 145 200 | |> method(:post) |
| 146 201 | |> url("/deployment/pause/#{deployment_id}") |
| 147 202 | |> add_param(:body, :body, deployment_pause_request) |
| 203 | + |> add_optional_params(optional_params, opts) |
| 148 204 | |> Enum.into([]) |
| 149 205 | |> (&Connection.request(connection, &1)).() |
| 150 206 | |> evaluate_response([ |
| @@ -161,6 +217,10 @@ defmodule NomadClient.Api.Deployments do | |
| 161 217 | - deployment_id (String.t): Specifies the UUID of the deployment. This must be the full UUID, not the short 8-character one. This is specified as part of the path |
| 162 218 | - deployment_promote_request (DeploymentPromoteRequest): |
| 163 219 | - opts (KeywordList): [optional] Optional parameters |
| 220 | + - :namespace (String.t): |
| 221 | + - :region (String.t): Make a request across regions to the given region |
| 222 | + - :index (integer()): index used for blocking requests |
| 223 | + - :wait (String.t): wait time used for blocking requests |
| 164 224 | ## Returns |
| 165 225 | |
| 166 226 | {:ok, NomadClient.Model.DeploymentUpdateResponse.t} on success |
| @@ -172,11 +232,19 @@ defmodule NomadClient.Api.Deployments do | |
| 172 232 | NomadClient.Model.DeploymentPromoteRequest.t(), |
| 173 233 | keyword() |
| 174 234 | ) :: {:ok, NomadClient.Model.DeploymentUpdateResponse.t()} | {:error, Tesla.Env.t()} |
| 175 | - def promote_deployment(connection, deployment_id, deployment_promote_request, _opts \\ []) do |
| 235 | + def promote_deployment(connection, deployment_id, deployment_promote_request, opts \\ []) do |
| 236 | + optional_params = %{ |
| 237 | + :namespace => :query, |
| 238 | + :region => :query, |
| 239 | + :index => :query, |
| 240 | + :wait => :query |
| 241 | + } |
| 242 | + |
| 176 243 | %{} |
| 177 244 | |> method(:post) |
| 178 245 | |> url("/deployment/promote/#{deployment_id}") |
| 179 246 | |> add_param(:body, :body, deployment_promote_request) |
| 247 | + |> add_optional_params(optional_params, opts) |
| 180 248 | |> Enum.into([]) |
| 181 249 | |> (&Connection.request(connection, &1)).() |
| 182 250 | |> evaluate_response([ |
| @@ -194,6 +262,10 @@ defmodule NomadClient.Api.Deployments do | |
| 194 262 | - deployment_id (String.t): Specifies the UUID of the deployment. This must be the full UUID, not the short 8-character one. This is specified as part of the path |
| 195 263 | - deployment_alloc_health_request (DeploymentAllocHealthRequest): |
| 196 264 | - opts (KeywordList): [optional] Optional parameters |
| 265 | + - :namespace (String.t): |
| 266 | + - :region (String.t): Make a request across regions to the given region |
| 267 | + - :index (integer()): index used for blocking requests |
| 268 | + - :wait (String.t): wait time used for blocking requests |
| 197 269 | ## Returns |
| 198 270 | |
| 199 271 | {:ok, NomadClient.Model.DeploymentUpdateResponse.t} on success |
| @@ -209,12 +281,20 @@ defmodule NomadClient.Api.Deployments do | |
| 209 281 | connection, |
| 210 282 | deployment_id, |
| 211 283 | deployment_alloc_health_request, |
| 212 | - _opts \\ [] |
| 284 | + opts \\ [] |
| 213 285 | ) do |
| 286 | + optional_params = %{ |
| 287 | + :namespace => :query, |
| 288 | + :region => :query, |
| 289 | + :index => :query, |
| 290 | + :wait => :query |
| 291 | + } |
| 292 | + |
| 214 293 | %{} |
| 215 294 | |> method(:post) |
| 216 295 | |> url("/deployment/allocation-health/#{deployment_id}") |
| 217 296 | |> add_param(:body, :body, deployment_alloc_health_request) |
| 297 | + |> add_optional_params(optional_params, opts) |
| 218 298 | |> Enum.into([]) |
| 219 299 | |> (&Connection.request(connection, &1)).() |
| 220 300 | |> evaluate_response([ |
Loading more files…