v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Kubernetes

Selectively Delete a Cluster and its Associated Resources

To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to /v2/kubernetes/clusters/$K8S_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.

delete/v2/kubernetes/clusters/{cluster_id}/destroy_with_associated_resources/selective

Path parameters

cluster_idstring uuid required

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

Request body

load_balancersstring[]

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

volumesstring[]

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

volume_snapshotsstring[]

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

Example request

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

Response

The action was successful and the response body is empty.