DigitalOcean.VolumeAction (digital_ocean v0.1.0)
Link to this section 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.
Link to this section Functions
Link to this function
create(volume_id, opts)
Specs
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{} }
Link to this function
create_by_name(opts)
Specs
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{} }
Link to this function
get(volume_id, action_id)
Specs
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{} }
Link to this function
list(volume_id, opts \\ [])
Specs
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{} }