ExIncus.StorageVolumes (ex_incus v1.0.0)

Copy Markdown

Manage storage volumes within a pool.

Volumes have a type; user-created ones are "custom", which is the default everywhere in this module (instances and images get volumes of their own types automatically).

{:ok, _} =
  ExIncus.StorageVolumes.create(client, "default", %{
    "name" => "shared-data",
    "config" => %{"size" => "10GiB"}
  })

Summary

Functions

Creates a volume from a StorageVolumesPost params map (needs "name"). The volume type defaults to "custom"; override with type:.

Fetches a single volume.

Lists volumes in a pool, all types. Pass type: to restrict (e.g. type: "custom").

Partially updates the volume configuration (PATCH).

Replaces the volume configuration (PUT).

Types

result()

@type result() :: {:ok, term()} | {:error, ExIncus.Error.t()}

Functions

create(client, pool, params, opts \\ [])

@spec create(ExIncus.Client.t(), String.t(), map(), keyword()) :: result()

Creates a volume from a StorageVolumesPost params map (needs "name"). The volume type defaults to "custom"; override with type:.

delete(client, pool, name, opts \\ [])

@spec delete(ExIncus.Client.t(), String.t(), String.t(), keyword()) :: result()

Deletes a volume.

get(client, pool, name, opts \\ [])

@spec get(ExIncus.Client.t(), String.t(), String.t(), keyword()) :: result()

Fetches a single volume.

list(client, pool, opts \\ [])

@spec list(ExIncus.Client.t(), String.t(), keyword()) :: result()

Lists volumes in a pool, all types. Pass type: to restrict (e.g. type: "custom").

patch(client, pool, name, params, opts \\ [])

@spec patch(ExIncus.Client.t(), String.t(), String.t(), map(), keyword()) :: result()

Partially updates the volume configuration (PATCH).

rename(client, pool, name, new_name, opts \\ [])

@spec rename(ExIncus.Client.t(), String.t(), String.t(), String.t(), keyword()) ::
  result()

Renames a volume.

update(client, pool, name, params, opts \\ [])

@spec update(ExIncus.Client.t(), String.t(), String.t(), map(), keyword()) :: result()

Replaces the volume configuration (PUT).