# Backups ## List `client.gpuDroplets.backups.list(numberdropletID, BackupListParamsquery?, RequestOptionsoptions?): BackupListResponse` **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. ### Parameters - `dropletID: number` - `query: BackupListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `BackupListResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `backups?: Array` - `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. - `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` 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. - `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. - `"snapshot"` - `"backup"` - `links?: PageLinks` - `pages?: ForwardLinks | BackwardLinks | unknown` - `ForwardLinks` - `last?: string` URI of the last page of the results. - `next?: string` URI of the next page of the results. - `BackwardLinks` - `first?: string` URI of the first page of the results. - `prev?: string` URI of the previous page of the results. - `unknown` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const backups = await client.gpuDroplets.backups.list(3164444); console.log(backups.meta); ``` ## List Policies `client.gpuDroplets.backups.listPolicies(BackupListPoliciesParamsquery?, RequestOptionsoptions?): BackupListPoliciesResponse` **get** `/v2/droplets/backups/policies` To list information about the backup policies for all Droplets in the account, send a GET request to `/v2/droplets/backups/policies`. ### Parameters - `query: BackupListPoliciesParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `BackupListPoliciesResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `links?: PageLinks` - `pages?: ForwardLinks | BackwardLinks | unknown` - `ForwardLinks` - `last?: string` URI of the last page of the results. - `next?: string` URI of the next page of the results. - `BackwardLinks` - `first?: string` URI of the first page of the results. - `prev?: string` URI of the previous page of the results. - `unknown` - `policies?: Record` A map where the keys are the Droplet IDs and the values are objects containing the backup policy information for each Droplet. - `backup_enabled?: boolean` A boolean value indicating whether backups are enabled for the Droplet. - `backup_policy?: DropletBackupPolicy` An object specifying the backup policy for the Droplet. - `hour?: 0 | 4 | 8 | 3 more` The hour of the day that the backup window will start. - `0` - `4` - `8` - `12` - `16` - `20` - `plan?: "daily" | "weekly"` The backup plan used for the Droplet. The plan can be either `daily` or `weekly`. - `"daily"` - `"weekly"` - `retention_period_days?: number` The number of days the backup will be retained. - `weekday?: "SUN" | "MON" | "TUE" | 4 more` The day of the week on which the backup will occur. - `"SUN"` - `"MON"` - `"TUE"` - `"WED"` - `"THU"` - `"FRI"` - `"SAT"` - `window_length_hours?: number` The length of the backup window starting from `hour`. - `droplet_id?: number` The unique identifier for the Droplet. - `next_backup_window?: DropletNextBackupWindow | null` An object containing keys with the start and end times of the window during which the backup will occur. - `end?: string` A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window. - `start?: string` A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const response = await client.gpuDroplets.backups.listPolicies(); console.log(response.meta); ``` ## List Supported Policies `client.gpuDroplets.backups.listSupportedPolicies(RequestOptionsoptions?): BackupListSupportedPoliciesResponse` **get** `/v2/droplets/backups/supported_policies` To retrieve a list of all supported Droplet backup policies, send a GET request to `/v2/droplets/backups/supported_policies`. ### Returns - `BackupListSupportedPoliciesResponse` - `supported_policies?: Array` - `name?: string` The name of the Droplet backup plan. - `possible_days?: Array` The day of the week the backup will occur. - `possible_window_starts?: Array` An array of integers representing the hours of the day that a backup can start. - `retention_period_days?: number` The number of days that a backup will be kept. - `window_length_hours?: number` The number of hours that a backup window is open. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const response = await client.gpuDroplets.backups.listSupportedPolicies(); console.log(response.supported_policies); ``` ## Retrieve Policy `client.gpuDroplets.backups.retrievePolicy(numberdropletID, RequestOptionsoptions?): BackupRetrievePolicyResponse` **get** `/v2/droplets/{droplet_id}/backups/policy` To show information about an individual Droplet's backup policy, send a GET request to `/v2/droplets/$DROPLET_ID/backups/policy`. ### Parameters - `dropletID: number` ### Returns - `BackupRetrievePolicyResponse` - `policy?: Policy` - `backup_enabled?: boolean` A boolean value indicating whether backups are enabled for the Droplet. - `backup_policy?: DropletBackupPolicy` An object specifying the backup policy for the Droplet. - `hour?: 0 | 4 | 8 | 3 more` The hour of the day that the backup window will start. - `0` - `4` - `8` - `12` - `16` - `20` - `plan?: "daily" | "weekly"` The backup plan used for the Droplet. The plan can be either `daily` or `weekly`. - `"daily"` - `"weekly"` - `retention_period_days?: number` The number of days the backup will be retained. - `weekday?: "SUN" | "MON" | "TUE" | 4 more` The day of the week on which the backup will occur. - `"SUN"` - `"MON"` - `"TUE"` - `"WED"` - `"THU"` - `"FRI"` - `"SAT"` - `window_length_hours?: number` The length of the backup window starting from `hour`. - `droplet_id?: number` The unique identifier for the Droplet. - `next_backup_window?: DropletNextBackupWindow | null` An object containing keys with the start and end times of the window during which the backup will occur. - `end?: string` A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window. - `start?: string` A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const response = await client.gpuDroplets.backups.retrievePolicy(3164444); console.log(response.policy); ```