droplets_associated_resources
Creates, updates, deletes, gets or lists a droplets_associated_resources
resource.
Overview
Name | droplets_associated_resources |
Type | Resource |
Id | digitalocean.compute.droplets_associated_resources |
Fields
The following fields are returned by SELECT
queries:
- droplets_list_associated_resources
A JSON object containing snapshots
, volumes
, and volume_snapshots
keys.
Name | Datatype | Description |
---|---|---|
floating_ips | array | Floating IPs that are associated with this Droplet. Requires reserved_ip:read scope. |
reserved_ips | array | Reserved IPs that are associated with this Droplet. Requires reserved_ip:read scope. |
snapshots | array | Snapshots that are associated with this Droplet. Requires image:read scope. |
volume_snapshots | array | Volume Snapshots that are associated with this Droplet. Requires block_storage_snapshot:read scope. |
volumes | array | Volumes that are associated with this Droplet. Requires block_storage:read scope. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
droplets_list_associated_resources | select | droplet_id | To list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources endpoint.This endpoint will only return resources that you are authorized to see. For example, to see associated Reserved IPs, include the reserved_ip:read scope.The response will be a JSON object containing snapshots , volumes , andvolume_snapshots keys. Each will be set to an array of objects containinginformation about the associated resources. | |
droplets_destroy_with_associated_resources_selective | exec | droplet_id | To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective endpoint. The JSON body of the request should include reserved_ips , snapshots , volumes ,or volume_snapshots keys each set to an array of IDs for the associatedresources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request will remain and continue to accrue changes on your account. A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources. | |
droplets_destroy_with_associated_resources_dangerous | exec | droplet_id , X-Dangerous | To destroy a Droplet along with all of its associated resources, send a DELETE request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous endpoint. The headers of this request must include an X-Dangerous key set totrue . To preview which resources will be destroyed, first query theDroplet's associated resources. This operation can not be reverse and should be used with caution. A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources. | |
droplets_get_destroy_associated_resources_status | exec | droplet_id | To check on the status of a request to destroy a Droplet with its associated resources, send a GET request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status endpoint. | |
droplets_destroy_retry_with_associated_resources | exec | droplet_id | If the status of a request to destroy a Droplet with its associated resources reported any errors, it can be retried by sending a POST request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry endpoint.Only one destroy can be active at a time per Droplet. If a retry is issued while another destroy is in progress for the Droplet a 409 status code will be returned. A successful response will include a 202 response code and no content. |
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 |
---|---|---|
X-Dangerous | boolean | Acknowledge this action will destroy the Droplet and all associated resources and can not be reversed. (example: true) |
droplet_id | integer | A unique identifier for a Droplet instance. (example: 3164444) |
SELECT
examples
- droplets_list_associated_resources
To list the associated billable resources that can be destroyed along with a
Droplet, send a GET request to the/v2/droplets/$DROPLET_ID/destroy_with_associated_resources
endpoint.
This endpoint will only return resources that you are authorized to see. For
example, to see associated Reserved IPs, include the reserved_ip:read
scope.
The response will be a JSON object containing snapshots
, volumes
, andvolume_snapshots
keys. Each will be set to an array of objects containing
information about the associated resources.
SELECT
floating_ips,
reserved_ips,
snapshots,
volume_snapshots,
volumes
FROM digitalocean.compute.droplets_associated_resources
WHERE droplet_id = '{{ droplet_id }}' -- required;
Lifecycle Methods
- droplets_destroy_with_associated_resources_selective
- droplets_destroy_with_associated_resources_dangerous
- droplets_get_destroy_associated_resources_status
- droplets_destroy_retry_with_associated_resources
To destroy a Droplet along with a sub-set of its associated resources, send a
DELETE request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective
endpoint. The JSON body of the request should include reserved_ips
, snapshots
, 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 Droplet's
associated resources. Any associated resource not included in the request
will remain and continue to accrue changes on your account.
A successful response will include a 202 response code and no content. Use
the status endpoint to check on the success or failure of the destruction of
the individual resources.
EXEC digitalocean.compute.droplets_associated_resources.droplets_destroy_with_associated_resources_selective
@droplet_id='{{ droplet_id }}' --required
@@json=
'{
"floating_ips": "{{ floating_ips }}",
"reserved_ips": "{{ reserved_ips }}",
"snapshots": "{{ snapshots }}",
"volumes": "{{ volumes }}",
"volume_snapshots": "{{ volume_snapshots }}"
}';
To destroy a Droplet along with all of its associated resources, send a DELETE
request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous
endpoint. The headers of this request must include an X-Dangerous
key set totrue
. To preview which resources will be destroyed, first query the
Droplet's associated resources. This operation can not be reverse and should
be used with caution.
A successful response will include a 202 response code and no content. Use the
status endpoint to check on the success or failure of the destruction of the
individual resources.
EXEC digitalocean.compute.droplets_associated_resources.droplets_destroy_with_associated_resources_dangerous
@droplet_id='{{ droplet_id }}' --required,
@X-Dangerous='{{ X-Dangerous }}' --required;
To check on the status of a request to destroy a Droplet with its associated
resources, send a GET request to the/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status
endpoint.
EXEC digitalocean.compute.droplets_associated_resources.droplets_get_destroy_associated_resources_status
@droplet_id='{{ droplet_id }}' --required;
If the status of a request to destroy a Droplet with its associated resources
reported any errors, it can be retried by sending a POST request to the/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry
endpoint.
Only one destroy can be active at a time per Droplet. If a retry is issued
while another destroy is in progress for the Droplet a 409 status code will
be returned. A successful response will include a 202 response code and no
content.
EXEC digitalocean.compute.droplets_associated_resources.droplets_destroy_retry_with_associated_resources
@droplet_id='{{ droplet_id }}' --required;