pydo.droplets.list_associated_resources()

Description

To list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources endpoint.

The response will be a JSON object containing snapshots, volumes, and volume_snapshots keys. Each will be set to an array of objects containing information about the associated resources.

Parameters

Name Type Required Description Default Value
droplet_id integer True A unique identifier for a Droplet instance.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

resp = client.droplets.list_associated_resources(droplet_id=594828)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

A JSON object containing snapshots, volumes, and volume_snapshots keys.

Click to expand an example response.
{
  "reserved_ips": [
    {
      "id": "6186916",
      "name": "45.55.96.47",
      "cost": "4.00"
    }
  ],
  "floating_ips": [
    {
      "id": "6186916",
      "name": "45.55.96.47",
      "cost": "4.00"
    }
  ],
  "snapshots": [
    {
      "id": "61486916",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330",
      "cost": "0.05"
    }
  ],
  "volumes": [
    {
      "id": "ba49449a-7435-11ea-b89e-0a58ac14480f",
      "name": "volume-nyc1-01",
      "cost": "10.00"
    }
  ],
  "volume_snapshots": [
    {
      "id": "edb0478d-7436-11ea-86e6-0a58ac144b91",
      "name": "volume-nyc1-01-1585758983629",
      "cost": "0.04"
    }
  ]
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}