pydo.kubernetes.list_associated_resources()

Description

To list the associated billable resources that can be destroyed along with a cluster, send a GET request to the /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources endpoint.

Parameters

Name Type Required Description Default Value
cluster_id string True A unique ID that can be used to reference a Kubernetes cluster.

Request Sample

import os
from pydo import Client

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

resp = client.kubernetes.list_associated_resources(cluster_id="da8fda8")

Responses

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

The response will be a JSON object containing load_balancers, volumes, and volume_snapshots keys. Each will be set to an array of objects containing the standard attributes for associated resources.

Click to expand an example response.
{
  "load_balancers": [
    {
      "id": "4de7ac8b-495b-4884-9a69-1050c6793cd6",
      "name": "lb-001"
    }
  ],
  "volumes": [
    {
      "id": "ba49449a-7435-11ea-b89e-0a58ac14480f",
      "name": "volume-001"
    }
  ],
  "volume_snapshots": [
    {
      "id": "edb0478d-7436-11ea-86e6-0a58ac144b91",
      "name": "snapshot-001"
    }
  ]
}

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"
}