Skip to main content

droplets_associated_resources

Creates, updates, deletes, gets or lists a droplets_associated_resources resource.

Overview

Namedroplets_associated_resources
TypeResource
Iddigitalocean.compute.droplets_associated_resources

Fields

The following fields are returned by SELECT queries:

A JSON object containing snapshots, volumes, and volume_snapshots keys.

NameDatatypeDescription
floating_ipsarrayFloating IPs that are associated with this Droplet.
Requires reserved_ip:read scope.
reserved_ipsarrayReserved IPs that are associated with this Droplet.
Requires reserved_ip:read scope.
snapshotsarraySnapshots that are associated with this Droplet.
Requires image:read scope.
volume_snapshotsarrayVolume Snapshots that are associated with this Droplet.
Requires block_storage_snapshot:read scope.
volumesarrayVolumes that are associated with this Droplet.
Requires block_storage:read scope.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
droplets_list_associated_resourcesselectdroplet_idTo 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, and
volume_snapshots keys. Each will be set to an array of objects containing
information about the associated resources.
droplets_destroy_with_associated_resources_selectiveexecdroplet_idTo 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.
droplets_destroy_with_associated_resources_dangerousexecdroplet_id, X-DangerousTo 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 to
true. 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.
droplets_get_destroy_associated_resources_statusexecdroplet_idTo 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_resourcesexecdroplet_idIf 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.

NameDatatypeDescription
X-DangerousbooleanAcknowledge this action will destroy the Droplet and all associated resources and can not be reversed. (example: true)
droplet_idintegerA unique identifier for a Droplet instance. (example: 3164444)

SELECT examples

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, and
volume_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

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 }}"
}';