Skip to content
  • Auto
  • Light
  • Dark

List

List Snapshots for a Volume
client.gpuDroplets.volumes.snapshots.list(stringvolumeID, SnapshotListParams { page, per_page } query?, RequestOptionsoptions?): SnapshotListResponse { meta, links, snapshots }
get/v2/volumes/{volume_id}/snapshots

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

ParametersExpand Collapse
volumeID: string
query: SnapshotListParams { page, per_page }
page?: number

Which 'page' of paginated results to return.

minimum1
per_page?: number

Number of items returned per page

minimum1
maximum200
ReturnsExpand Collapse
SnapshotListResponse { meta, links, snapshots }
meta: MetaProperties { total }

Information about the response itself.

total?: number

Number of objects returned by the request.

Accepts one of the following:

URI of the last page of the results.

URI of the next page of the results.

URI of the first page of the results.

URI of the previous page of the results.

snapshots?: Array<Snapshots { id, created_at, min_disk_size, 6 more } >
id: string

The unique identifier for the snapshot.

created_at: string

A time value given in ISO8601 combined date and time format that represents when the snapshot was created.

formatdate-time
min_disk_size: number

The minimum size in GB required for a volume or Droplet to use this snapshot.

name: string

A human-readable name for the snapshot.

regions: Array<string>

An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values.

resource_id: string

The unique identifier for the resource that the snapshot originated from.

resource_type: "droplet" | "volume"

The type of resource that the snapshot originated from.

Accepts one of the following:
"droplet"
"volume"
size_gigabytes: number

The billable size of the snapshot in gigabytes.

formatfloat
tags: Array<string> | null

An array of Tags the snapshot has been tagged with.

Requires tag:read scope.

List Snapshots for a Volume
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

const snapshots = await client.gpuDroplets.volumes.snapshots.list('7724db7c-e098-11e5-b522-000f53304e51');

console.log(snapshots.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": "8eb4d51a-873f-11e6-96bf-000f53315a41",
      "created_at": "2020-09-30T18:56:12Z",
      "min_disk_size": 10,
      "name": "big-data-snapshot1475261752",
      "regions": [
        "nyc1"
      ],
      "resource_id": "82a48a18-873f-11e6-96bf-000f53315a41",
      "resource_type": "volume",
      "size_gigabytes": 0,
      "tags": [
        "string"
      ]
    }
  ]
}
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": "8eb4d51a-873f-11e6-96bf-000f53315a41",
      "created_at": "2020-09-30T18:56:12Z",
      "min_disk_size": 10,
      "name": "big-data-snapshot1475261752",
      "regions": [
        "nyc1"
      ],
      "resource_id": "82a48a18-873f-11e6-96bf-000f53315a41",
      "resource_type": "volume",
      "size_gigabytes": 0,
      "tags": [
        "string"
      ]
    }
  ]
}