NomadClient.Api.Nodes (nomad_client v0.13.1)

API calls for all endpoints tagged Nodes.

Link to this section Summary

Functions

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

Returns

  • {:ok, NomadClient.Model.Node.t} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

Returns

  • {:ok, [%AllocationListStub{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (NomadClient.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.
    • :resources (boolean()): Whether or not to include the NodeResources and ReservedResources fields in the response.

Returns

  • {:ok, [%NodeListStub{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • node_update_drain_request (NodeUpdateDrainRequest):
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

Returns

  • {:ok, NomadClient.Model.NodeDrainUpdateResponse.t} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • node_update_eligibility_request (NodeUpdateEligibilityRequest):
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

Returns

  • {:ok, NomadClient.Model.NodeEligibilityUpdateResponse.t} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

Returns

  • {:ok, NomadClient.Model.NodePurgeResponse.t} on success
  • {:error, Tesla.Env.t} on failure

Link to this section Functions

Link to this function

get_node(connection, node_id, opts \\ [])

@spec get_node(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:ok, NomadClient.Model.Node.t()} | {:error, Tesla.Env.t()}

parameters

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

returns

Returns

  • {:ok, NomadClient.Model.Node.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

get_node_allocations(connection, node_id, opts \\ [])

@spec get_node_allocations(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, [NomadClient.Model.AllocationListStub.t()]}
  | {:error, Tesla.Env.t()}

parameters

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

returns

Returns

  • {:ok, [%AllocationListStub{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

get_nodes(connection, opts \\ [])

@spec get_nodes(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, [NomadClient.Model.NodeListStub.t()]}
  | {:error, Tesla.Env.t()}

parameters

Parameters

  • connection (NomadClient.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.
    • :resources (boolean()): Whether or not to include the NodeResources and ReservedResources fields in the response.

returns

Returns

  • {:ok, [%NodeListStub{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

update_node_drain(connection, node_id, node_update_drain_request, opts \\ [])

parameters

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • node_update_drain_request (NodeUpdateDrainRequest):
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

returns

Returns

  • {:ok, NomadClient.Model.NodeDrainUpdateResponse.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

update_node_eligibility(connection, node_id, node_update_eligibility_request, opts \\ [])

parameters

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • node_update_eligibility_request (NodeUpdateEligibilityRequest):
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

returns

Returns

  • {:ok, NomadClient.Model.NodeEligibilityUpdateResponse.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

update_node_purge(connection, node_id, opts \\ [])

@spec update_node_purge(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, NomadClient.Model.NodePurgeResponse.t()}
  | {:error, Tesla.Env.t()}

parameters

Parameters

  • connection (NomadClient.Connection): Connection to server
  • node_id (String.t): The ID of the node.
  • opts (keyword): Optional parameters
    • :region (String.t): Filters results based on the specified region.
    • :namespace (String.t): Filters results based on the specified namespace.
    • :index (integer()): If set, wait until query exceeds given index. Must be provided with WaitParam.
    • :wait (String.t): Provided with IndexParam to wait for change.
    • :stale (String.t): If present, results will include stale reads.
    • :prefix (String.t): Constrains results to jobs that start with the defined prefix
    • :x_nomad_token (String.t): A Nomad ACL token.
    • :per_page (integer()): Maximum number of results to return.
    • :next_token (String.t): Indicates where to start paging for queries that support pagination.

returns

Returns

  • {:ok, NomadClient.Model.NodePurgeResponse.t} on success
  • {:error, Tesla.Env.t} on failure