droplet_snapshots
Creates, updates, deletes, gets or lists a droplet_snapshots
resource.
Overview
Name | droplet_snapshots |
Type | Resource |
Id | digitalocean.compute.droplet_snapshots |
Fields
The following fields are returned by SELECT
queries:
- droplets_list_snapshots
A JSON object with an snapshots
key.
Name | Datatype | Description |
---|---|---|
id | integer | The unique identifier for the snapshot or backup. |
name | string | A human-readable name for the snapshot. (example: web-01-1595954862243) |
created_at | string (date-time) | A time value given in ISO8601 combined date and time format that represents when the snapshot was created. (example: 2020-07-28T16:47:44Z) |
min_disk_size | integer | The minimum size in GB required for a volume or Droplet to use this snapshot. |
regions | array | An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values. |
size_gigabytes | number (float) | The billable size of the snapshot in gigabytes. |
type | string | Describes the kind of image. It may be one of snapshot or backup . This specifies whether an image is a user-generated Droplet snapshot or automatically created Droplet backup. (example: snapshot) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
droplets_list_snapshots | select | droplet_id | per_page , page | To retrieve the snapshots that have been created from a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/snapshots .You will get back a JSON object that has a snapshots key. This will be setto an array of snapshot objects, each of which contain the standard Droplet snapshot attributes. |
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 |
---|---|---|
droplet_id | integer | A unique identifier for a Droplet instance. (example: 3164444) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT
examples
- droplets_list_snapshots
To retrieve the snapshots that have been created from a Droplet, send a GET
request to /v2/droplets/$DROPLET_ID/snapshots
.
You will get back a JSON object that has a snapshots
key. This will be set
to an array of snapshot objects, each of which contain the standard Droplet
snapshot attributes.
SELECT
id,
name,
created_at,
min_disk_size,
regions,
size_gigabytes,
type
FROM digitalocean.compute.droplet_snapshots
WHERE droplet_id = '{{ droplet_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}';