Skip to main content

associated_resources

Creates, updates, deletes, gets or lists an associated_resources resource.

Overview

Nameassociated_resources
TypeResource
Iddigitalocean.kubernetes.associated_resources

Fields

The following fields are returned by SELECT queries:

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.

NameDatatypeDescription
load_balancersarrayA list of names and IDs for associated load balancers that can be destroyed along with the cluster.
volume_snapshotsarrayA list of names and IDs for associated volume snapshots that can be destroyed along with the cluster.
volumesarrayA list of names and IDs for associated volumes that can be destroyed along with the cluster.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
kubernetes_list_associated_resourcesselectcluster_idTo 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.
kubernetes_destroy_associated_resources_selectivedeletecluster_idTo 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.
kubernetes_destroy_associated_resources_dangerousexeccluster_idTo delete a Kubernetes cluster with all of its associated resources, send a
DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/dangerous.
A 204 status code with no body will be returned in response to a successful request.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
cluster_idstring (uuid)A unique ID that can be used to reference a Kubernetes cluster. (example: bd5f5959-5e1e-4205-a714-a914373942af)

SELECT examples

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.

SELECT
load_balancers,
volume_snapshots,
volumes
FROM digitalocean.kubernetes.associated_resources
WHERE cluster_id = '{{ cluster_id }}' -- required;

DELETE examples

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 FROM digitalocean.kubernetes.associated_resources
WHERE cluster_id = '{{ cluster_id }}' --required;

Lifecycle Methods

To delete a Kubernetes cluster with all of its associated resources, send a
DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/dangerous.
A 204 status code with no body will be returned in response to a successful request.

EXEC digitalocean.kubernetes.associated_resources.kubernetes_destroy_associated_resources_dangerous 
@cluster_id='{{ cluster_id }}' --required;