Skip to main content

snapshots

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

Overview

Namesnapshots
TypeResource
Iddigitalocean.storage.snapshots

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called snapshot. The value will be an object containing the standard attributes associated with an NFS snapshot.

NameDatatypeDescription
idstringThe unique identifier of the snapshot. (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d)
namestringThe human-readable name of the snapshot. (example: daily-backup)
share_idstring (uuid)The unique identifier of the share from which this snapshot was created. (example: 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d)
created_atstring (date-time)The timestamp when the snapshot was created. (example: 2023-11-14T16:29:21Z)
regionstringThe DigitalOcean region slug where the snapshot is located. (example: atl1)
size_gibinteger (uint64)The size of the snapshot in GiB.
statusstringThe current status of the snapshot. (UNKNOWN, CREATING, ACTIVE, FAILED, DELETED) (example: CREATING)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
nfs_get_snapshotselectnfs_snapshot_idregionTo get an NFS snapshot, send a GET request to /v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}.

A successful request will return the NFS snapshot.
nfs_list_snapshotselectregion, share_idTo list all NFS snapshots, send a GET request to /v2/nfs/snapshots?region=${region}&share_id={share_id}.

A successful request will return all NFS snapshots belonging to the authenticated user in the specified region.

Optionally, you can filter snapshots by a specific NFS share by including the share_id query parameter.
nfs_delete_snapshotdeletenfs_snapshot_idregionTo delete an NFS snapshot, send a DELETE request to /v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}.

A successful request will return a 204 No Content status code.

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
nfs_snapshot_idstringThe unique ID of the NFS snapshot (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d)
regionstringThe DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. (example: atl1)
share_idstringThe unique ID of an NFS share. If provided, only snapshots of this specific share will be returned. (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d)

SELECT examples

To get an NFS snapshot, send a GET request to /v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}.

A successful request will return the NFS snapshot.

SELECT
id,
name,
share_id,
created_at,
region,
size_gib,
status
FROM digitalocean.storage.snapshots
WHERE nfs_snapshot_id = '{{ nfs_snapshot_id }}' -- required
AND region = '{{ region }}'
;

DELETE examples

To delete an NFS snapshot, send a DELETE request to /v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}.

A successful request will return a 204 No Content status code.

DELETE FROM digitalocean.storage.snapshots
WHERE nfs_snapshot_id = '{{ nfs_snapshot_id }}' --required
AND region = '{{ region }}'
;