DigitalOcean.VolumeAction (digital_ocean v0.5.0)
Summary
Functions
Create an action for a volume.
Create an action for a volume by name.
Retrieve a volume action.
Retrieve a list of actions that have been executed on a volume.
Functions
@spec create(String.t(), Keyword.t()) :: DigitalOcean.Operation.t()
Create an action for a volume.
Example for attaching a volume to a droplet
iex> DigitalOcean.VolumeAction.create(
...> "7724db7c-e098-11e5-b522-000f53304e51",
...> type: "attach",
...> droplet_id: 11612190,
...> region: "nyc1",
...> tags: ["aninterestingtag"]
...> ) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }Example for removing a volume from a droplet
iex> DigitalOcean.VolumeAction.create(
...> "7724db7c-e098-11e5-b522-000f53304e51",
...> type: "detach",
...> droplet_id: 11612190,
...> region: "nyc1"
...> ) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }Example for resizing a volume
iex> DigitalOcean.VolumeAction.create(
...> "7724db7c-e098-11e5-b522-000f53304e51",
...> type: "resize",
...> size_gigabytes: 100,
...> region: "nyc1"
...> ) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
@spec create_by_name(Keyword.t()) :: DigitalOcean.Operation.t()
Create an action for a volume by name.
Example for attaching a volume to a droplet
iex> DigitalOcean.VolumeAction.create(
...> type: "attach",
...> volume_name: "example",
...> region: "nyc1",
...> droplet_id: 11612190,
...> tags: ["aninterestingname"]
...> ) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }Example for detaching a volume from a droplet
iex> DigitalOcean.VolumeAction.create(
...> type: "detach",
...> droplet_id: 11612190,
...> volume_name: "example",
...> region: "nyc1"
...> ) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
@spec get(String.t(), DigitalOcean.id_t()) :: DigitalOcean.Operation.t()
Retrieve a volume action.
Examples
iex> DigitalOcean.VolumeAction.get("7724db7c-e098-11e5-b522-000f53304e51", 72531856) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
@spec list(String.t(), Keyword.t()) :: DigitalOcean.Operation.t()
Retrieve a list of actions that have been executed on a volume.
Examples
iex> DigitalOcean.VolumeAction.list("7724db7c-e098-11e5-b522-000f53304e51") |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }