snapshots
Creates, updates, deletes, gets or lists a snapshots resource.
Overview
| Name | snapshots |
| Type | Resource |
| Id | digitalocean.storage.snapshots |
Fields
The following fields are returned by SELECT queries:
- nfs_get_snapshot
- nfs_list_snapshot
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the snapshot. (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d) |
name | string | The human-readable name of the snapshot. (example: daily-backup) |
share_id | string (uuid) | The unique identifier of the share from which this snapshot was created. (example: 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d) |
created_at | string (date-time) | The timestamp when the snapshot was created. (example: 2023-11-14T16:29:21Z) |
region | string | The DigitalOcean region slug where the snapshot is located. (example: atl1) |
size_gib | integer (uint64) | The size of the snapshot in GiB. |
status | string | The current status of the snapshot. (UNKNOWN, CREATING, ACTIVE, FAILED, DELETED) (example: CREATING) |
The response will be a JSON object with a key called snapshots. The value will be an array of objects, each containing the standard attributes associated with an NFS snapshot.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the snapshot. (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d) |
name | string | The human-readable name of the snapshot. (example: daily-backup) |
share_id | string (uuid) | The unique identifier of the share from which this snapshot was created. (example: 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d) |
created_at | string (date-time) | The timestamp when the snapshot was created. (example: 2023-11-14T16:29:21Z) |
region | string | The DigitalOcean region slug where the snapshot is located. (example: atl1) |
size_gib | integer (uint64) | The size of the snapshot in GiB. |
status | string | The current status of the snapshot. (UNKNOWN, CREATING, ACTIVE, FAILED, DELETED) (example: CREATING) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
nfs_get_snapshot | select | nfs_snapshot_id | region | 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. |
nfs_list_snapshot | select | region, share_id | To 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_snapshot | delete | nfs_snapshot_id | region | 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. |
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 |
|---|---|---|
nfs_snapshot_id | string | The unique ID of the NFS snapshot (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d) |
region | string | The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. (example: atl1) |
share_id | string | The 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
- nfs_get_snapshot
- nfs_list_snapshot
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 }}'
;
To 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.
SELECT
id,
name,
share_id,
created_at,
region,
size_gib,
status
FROM digitalocean.storage.snapshots
WHERE region = '{{ region }}'
AND share_id = '{{ share_id }}'
;
DELETE examples
- nfs_delete_snapshot
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 }}'
;