Skip to content

List Backups for a Droplet

client.gpuDroplets.backups.list(numberdropletID, BackupListParams { page, per_page } query?, RequestOptionsoptions?): BackupListResponse { meta, backups, links }
get/v2/droplets/{droplet_id}/backups

To retrieve any backups associated with a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/backups.

You will get back a JSON object that has a backups key. This will be set to an array of backup objects, each of which contain the standard Droplet backup attributes.

ParametersExpand Collapse
dropletID: number
minimum1
query: BackupListParams { 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
BackupListResponse { meta, backups, links }
meta: MetaProperties { total }

Information about the response itself.

total?: number

Number of objects returned by the request.

backups?: Array<Backup>
id: number

The unique identifier for the snapshot or backup.

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.

size_gigabytes: number

The billable size of the snapshot in gigabytes.

formatfloat
type: "snapshot" | "backup"

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.

Accepts one of the following:
"snapshot"
"backup"
Accepts one of the following:
List Backups for a Droplet
import Gradient from '@digitalocean/gradient';

const client = new Gradient({
  accessToken: 'My Access Token',
});

const backups = await client.gpuDroplets.backups.list(3164444);

console.log(backups.meta);
{
  "meta": {
    "total": 1
  },
  "backups": [
    {
      "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"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=2",
      "next": "https://api.digitalocean.com/v2/images?page=2"
    }
  }
}
Returns Examples
{
  "meta": {
    "total": 1
  },
  "backups": [
    {
      "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"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=2",
      "next": "https://api.digitalocean.com/v2/images?page=2"
    }
  }
}