DockerEngineAPI.Api.Volume (elixir_dea v1.45.7)

API calls for all endpoints tagged Volume.

Summary

Functions

Remove a volume Instruct the driver to remove the volume.

Delete unused volumes

"Update a volume. Valid only for Swarm cluster volumes"

Functions

Link to this function

volume_create(connection, volume_config, opts \\ [])

Create a volume

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • volume_config (VolumeCreateOptions): Volume configuration
  • opts (keyword): Optional parameters

Returns

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

volume_delete(connection, name, opts \\ [])

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

Remove a volume Instruct the driver to remove the volume.

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • name (String.t): Volume name or ID
  • opts (keyword): Optional parameters
    • :force (boolean()): Force the removal of the volume

Returns

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

volume_inspect(connection, name, opts \\ [])

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

Inspect a volume

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • name (String.t): Volume name or ID
  • opts (keyword): Optional parameters

Returns

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

volume_list(connection, opts \\ [])

List volumes

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :filters (String.t): JSON encoded value of the filters (a map[string][]string) to process on the volumes list. Available filters: - dangling=<boolean> When set to true (or 1), returns all volumes that are not in use by a container. When set to false (or 0), only volumes that are in use by one or more containers are returned. - driver=<volume-driver-name> Matches volumes based on their driver. - label=<key> or label=<key>:<value> Matches volumes based on the presence of a label alone or a label and a value. - name=<volume-name> Matches all or part of a volume name.

Returns

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

volume_prune(connection, opts \\ [])

Delete unused volumes

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :filters (String.t): Filters to process on the prune list, encoded as JSON (a map[string][]string). Available filters: - label (label=<key>, label=<key>=<value>, label!=<key>, or label!=<key>=<value>) Prune volumes with (or without, in case label!=... is used) the specified labels. - all (all=true) - Consider all (local) volumes for pruning and not just anonymous volumes.

Returns

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

volume_update(connection, name, version, opts \\ [])

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

"Update a volume. Valid only for Swarm cluster volumes"

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • name (String.t): The name or ID of the volume
  • version (integer()): The version number of the volume being updated. This is required to avoid conflicting writes. Found in the volume's ClusterVolume field.
  • opts (keyword): Optional parameters
    • :body (VolumeUpdateRequest): The spec of the volume to update. Currently, only Availability may change. All other fields must remain unchanged.

Returns

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