DockerEngineAPI.Api.Swarm (elixir_dea v1.45.7)

API calls for all endpoints tagged Swarm.

Summary

Functions

Link to this function

swarm_init(connection, body, opts \\ [])

Initialize a new swarm

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • body (SwarmInitRequest):
  • opts (keyword): Optional parameters

Returns

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

swarm_inspect(connection, opts \\ [])

@spec swarm_inspect(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, DockerEngineAPI.Model.Swarm.t()}
  | {:ok, DockerEngineAPI.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Inspect swarm

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

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

swarm_join(connection, body, opts \\ [])

Join an existing swarm

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • body (SwarmJoinRequest):
  • opts (keyword): Optional parameters

Returns

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

swarm_leave(connection, opts \\ [])

@spec swarm_leave(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, DockerEngineAPI.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Leave a swarm

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :force (boolean()): Force leave swarm, even if this is the last manager or that it will break the cluster.

Returns

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

swarm_unlock(connection, body, opts \\ [])

Unlock a locked manager

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • body (SwarmUnlockRequest):
  • opts (keyword): Optional parameters

Returns

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

swarm_unlockkey(connection, opts \\ [])

Get the unlock key

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

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

swarm_update(connection, version, body, opts \\ [])

@spec swarm_update(
  Tesla.Env.client(),
  integer(),
  DockerEngineAPI.Model.SwarmSpec.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, DockerEngineAPI.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Update a swarm

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • version (integer()): The version number of the swarm object being updated. This is required to avoid conflicting writes.
  • body (SwarmSpec):
  • opts (keyword): Optional parameters
    • :rotateWorkerToken (boolean()): Rotate the worker join token.
    • :rotateManagerToken (boolean()): Rotate the manager join token.
    • :rotateManagerUnlockKey (boolean()): Rotate the manager unlock key.

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure