DigitalOcean.Droplet (digital_ocean v0.1.0)

Link to this section Summary

Functions

Create one or more droplets.

Delete a droplet.

Delete a droplet with all associated resources.

Delete a droplet with a sub-set of associated resources.

Retrieve a droplet.

Retrieve the status of a request to delete a droplet with it's associated resources.

Retrieve a list of droplets.

Retrieve a list of actions that have been executed on a droplet.

Retrieve a list of associated billable resources that can be deleted along with a droplet.

Retrieve a list of available kernels for a droplet.

Retrieve a list of backups for a droplet.

Retrieve droplets located on the same physical hardware.

Retrieve a list of neighbors for a droplet.

Retrieve a list of snapshots for a droplet.

Retry deleting a droplet with associated resources.

Link to this section Functions

Specs

Create one or more droplets.

Example creating a single droplet

iex> DigitalOcean.Droplet.create(
...>   name: "example.com",
...>   region: "nyc3",
...>   size: "s-1vcpu-1gb",
...>   image: "ubuntu-16-04-x64",
...>   ssh_keys: [107149],
...>   backups: false,
...>   ipv6: true,
...>   tags: ["web"]
...> ) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }

Example creating multiple droplets

iex> DigitalOcean.Droplet.create(
...>   names: [
...>     "sub-01.example.com",
...>     "sub-02.example.com",
...>   ],
...>   region: "nyc3",
...>   size: "s-1vcpu-1gb",
...>   image: "ubuntu-16-04-x64",
...>   ssh_keys: [107149],
...>   backups: false,
...>   ipv6: true,
...>   tags: ["web"]
...> ) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

delete(droplet_id, opts \\ [])

Specs

Delete a droplet.

Examples

iex> DigitalOcean.Droplet.delete(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

delete_with_all_associated_resources(droplet_id)

Specs

delete_with_all_associated_resources(DigitalOcean.id_t()) ::
  DigitalOcean.Operation.t()

Delete a droplet with all associated resources.

Examples

iex> DigitalOcean.Droplet.delete_with_all_associated_resources(187000742) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

delete_with_associated_resources(droplet_id, opts)

Specs

delete_with_associated_resources(DigitalOcean.id_t(), Keyword.t()) ::
  DigitalOcean.Operation.t()

Delete a droplet with a sub-set of associated resources.

Examples

iex> DigitalOcean.Droplet.delete_with_associated_resources(
...>   187000742,
...>   snapshots: [
...>     "61486916"
...>   ],
...>   volumes: [
...>     "ba49449a-7435-11ea-b89e-0a58ac14480f"
...>   ],
...>   volume_snapshots: [
...>     "edb0478d-7436-11ea-86e6-0a58ac144b91"
...>   ]
...> )
...> { :ok, %DigitalOcean.Response{} }
Link to this function

get(droplet_id)

Specs

Retrieve a droplet.

Examples

iex> DigitalOcean.Droplet.get(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response() }
Link to this function

get_delete_with_associated_resources_status(droplet_id)

Retrieve the status of a request to delete a droplet with it's associated resources.

Examples

Link to this function

list(opts \\ [])

Specs

Retrieve a list of droplets.

Example retrieving droplets

iex> DigitalOcean.Droplet.list() |> DigitalOcean.request()
{ :ok, %DigitalOcean.Operation{} }

Example retrieving droplets by tag

iex> DigitalOcean.Droplet.list(tag_name: "awesome") |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

list_actions(droplet_id, opts \\ [])

Specs

Retrieve a list of actions that have been executed on a droplet.

Examples

iex> DigitalOcean.Droplet.list_actions(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

list_associated_resources(droplet_id, opts \\ [])

Specs

list_associated_resources(DigitalOcean.id_t(), Keyword.t()) ::
  DigitalOcean.Operation.t()

Retrieve a list of associated billable resources that can be deleted along with a droplet.

Examples

iex> DigitalOcean.Droplet.list_associated_resources(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

list_available_kernels(droplet_id, opts \\ [])

Specs

list_available_kernels(DigitalOcean.id_t(), Keyword.t()) ::
  DigitalOcean.Operation.t()

Retrieve a list of available kernels for a droplet.

Examples

iex> DigitalOcean.Droplet.list_available_kernels(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

list_backups(droplet_id, opts \\ [])

Specs

Retrieve a list of backups for a droplet.

Examples

iex> DigitalOcean.Droplet.list_backups(3067509) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

list_for_neightbors(opts \\ [])

Specs

list_for_neightbors(Keyword.t()) :: DigitalOcean.Operation.t()

Retrieve droplets located on the same physical hardware.

Examples

iex> DigitalOcean.Droplet.list_for_neightbors() |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

list_neighbors(droplet_id, opts \\ [])

Specs

Retrieve a list of neighbors for a droplet.

Examples

iex> DigitalOcean.Droplet.list_neighbors(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

list_snapshots(droplet_id, opts \\ [])

Specs

Retrieve a list of snapshots for a droplet.

Examples

iex> DigitalOcean.Droplet.list_snapshots(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }
Link to this function

retry_delete_with_associated_resources(droplet_id)

Specs

retry_delete_with_associated_resources(DigitalOcean.id_t()) ::
  DigitalOcean.Operation.t()

Retry deleting a droplet with associated resources.

Examples

iex> DigitalOcean.Droplet.retry_delete_with_associated_resources(3164494) |> DigitalOcean.request()
{ :ok, %DigitalOcean.Response{} }