associated_resources
Creates, updates, deletes, gets or lists an associated_resources
resource.
Overview
Name | associated_resources |
Type | Resource |
Id | digitalocean.kubernetes.associated_resources |
Fields
The following fields are returned by SELECT
queries:
- kubernetes_list_associated_resources
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.
Name | Datatype | Description |
---|---|---|
load_balancers | array | A list of names and IDs for associated load balancers that can be destroyed along with the cluster. |
volume_snapshots | array | A list of names and IDs for associated volume snapshots that can be destroyed along with the cluster. |
volumes | array | A 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
kubernetes_list_associated_resources | select | cluster_id | 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. | |
kubernetes_destroy_associated_resources_selective | delete | cluster_id | 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 , orvolume_snapshots keys each set to an array of IDs for the associatedresources 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_dangerous | exec | cluster_id | 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. |
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.
Name | Datatype | Description |
---|---|---|
cluster_id | string (uuid) | A unique ID that can be used to reference a Kubernetes cluster. (example: bd5f5959-5e1e-4205-a714-a914373942af) |
SELECT
examples
- kubernetes_list_associated_resources
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
- kubernetes_destroy_associated_resources_selective
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
, orvolume_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
- kubernetes_destroy_associated_resources_dangerous
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;