List Snapshots
List Snapshots for a Droplet
client.gpuDroplets.listSnapshots(numberdropletID, GPUDropletListSnapshotsParams { page, per_page } query?, RequestOptionsoptions?): GPUDropletListSnapshotsResponse { meta, links, snapshots }
/v2/droplets/{droplet_id}/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.
Parameters
dropletID: number
Returns
List Snapshots for a Droplet
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.listSnapshots(3164444);
console.log(response.meta);
{
"meta": {
"total": 1
},
"links": {
"pages": {
"last": "https://api.digitalocean.com/v2/images?page=2",
"next": "https://api.digitalocean.com/v2/images?page=2"
}
},
"snapshots": [
{
"id": 6372321,
"created_at": "2020-07-28T16:47:44Z",
"min_disk_size": 25,
"name": "web-01-1595954862243",
"regions": [
"nyc3",
"sfo3"
],
"size_gigabytes": 2.34,
"type": "snapshot"
}
]
}
Returns Examples
{
"meta": {
"total": 1
},
"links": {
"pages": {
"last": "https://api.digitalocean.com/v2/images?page=2",
"next": "https://api.digitalocean.com/v2/images?page=2"
}
},
"snapshots": [
{
"id": 6372321,
"created_at": "2020-07-28T16:47:44Z",
"min_disk_size": 25,
"name": "web-01-1595954862243",
"regions": [
"nyc3",
"sfo3"
],
"size_gigabytes": 2.34,
"type": "snapshot"
}
]
}