pydo.kubernetes.destroy_associated_resources_selective()

Generated on 3 Aug 2026 from pydo version v0.40.0

Usage

client.kubernetes.destroy_associated_resources_selective(
    cluster_id="bd5f5959-5e1e-4205-a714-a914373942af",
    body={
        "load_balancers": [...],
        "volumes": [...],
        "volume_snapshots": [...],
    },
)
Returns NoneRaises HttpResponseError

Description

To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to /v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources/selective.

The JSON body of the request should include load_balancers, volumes, or volume_snapshots keys each set to an array of IDs for the associated resources to be destroyed.

The IDs can be found by querying the cluster’s associated resources endpoint. Any associated resource not included in the request will remain and continue to accrue changes on your account.

Parameters

cluster_id string required

A unique ID that can be used to reference a Kubernetes cluster.

Min: 1

load_balancers array of strings optional

Example: ['4de7ac8b-495b-4884-9a69-1050c6793cd6']

A list of IDs for associated load balancers to destroy along with the cluster.

volumes array of strings optional

Example: ['ba49449a-7435-11ea-b89e-0a58ac14480f']

A list of IDs for associated volumes to destroy along with the cluster.

volume_snapshots array of strings optional

Example: ['edb0478d-7436-11ea-86e6-0a58ac144b91']

A list of IDs for associated volume snapshots to destroy along with the cluster.

Request Sample

Show Request Sample
import os
from pydo import Client

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

req = {
  "load_balancers": [
    "4de7ac8b-495b-4884-9a69-1050c6793cd6"
  ],
  "volumes": [
    "ba49449a-7435-11ea-b89e-0a58ac14480f"
  ],
  "volume_snapshots": [
    "edb0478d-7436-11ea-86e6-0a58ac144b91"
  ]
}

resp = client.kubernetes.destroy_associated_resources_selective(cluster_id="da8fda8", body=req)

More Information

See /v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources/selective in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.