dots.v2.kubernetes.clusters.byCluster_id().destroy_with_associated_resources.selective.delete()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.kubernetes.clusters.byCluster_id(cluster_id).destroy_with_associated_resources.selective.delete(body: Destroy_associated_kubernetes_resources, requestConfiguration?: RequestConfiguration<object>): Promise<void>

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

Path Parameters

cluster_id string required

Example: bd5f5959-5e1e-4205-a714-a914373942af

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

Min: 1

Request Body

loadBalancers 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.

volumeSnapshots 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 { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

await client.v2.kubernetes.clusters
    .byCluster_id("bd5f5959-5e1e-4205-a714-a914373942af").destroy_with_associated_resources.selective.delete({
    loadBalancers: [
        "4de7ac8b-495b-4884-9a69-1050c6793cd6",
    ],
    volumes: [
        "ba49449a-7435-11ea-b89e-0a58ac14480f",
    ],
    volumeSnapshots: [
        "edb0478d-7436-11ea-86e6-0a58ac144b91",
    ],
});

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.