Skip to main content

volumes_snapshots

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

Overview

Namevolumes_snapshots
TypeResource
Iddigitalocean.block_storage.volumes_snapshots

Fields

NameDatatypeDescription
column_anon``

Methods

NameAccessible byRequired ParamsDescription
volume_snapshots_get_by_idSELECTsnapshot_idTo retrieve the details of a snapshot that has been created from a volume, send a GET request to /v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID.
volume_snapshots_listSELECTvolume_idTo retrieve the snapshots that have been created from a volume, send a GET request to /v2/volumes/$VOLUME_ID/snapshots.
volume_snapshots_createINSERTvolume_id, data__nameTo create a snapshot from a volume, sent a POST request to /v2/volumes/$VOLUME_ID/snapshots.
volume_snapshots_delete_by_idDELETEsnapshot_idTo delete a volume snapshot, send a DELETE request to /v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

SELECT examples

To retrieve the snapshots that have been created from a volume, send a GET request to /v2/volumes/$VOLUME_ID/snapshots.

SELECT
column_anon
FROM digitalocean.block_storage.volumes_snapshots
WHERE volume_id = '{{ volume_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new volumes_snapshots resource.

/*+ create */
INSERT INTO digitalocean.block_storage.volumes_snapshots (
data__name,
data__tags,
volume_id
)
SELECT
'{{ name }}',
'{{ tags }}',
'{{ volume_id }}'
;

DELETE example

Deletes the specified volumes_snapshots resource.

/*+ delete */
DELETE FROM digitalocean.block_storage.volumes_snapshots
WHERE snapshot_id = '{{ snapshot_id }}';