droplet_backup_policies
Creates, updates, deletes, gets or lists a droplet_backup_policies resource.
Overview
| Name | droplet_backup_policies |
| Type | Resource |
| Id | digitalocean.compute.droplet_backup_policies |
Fields
The following fields are returned by SELECT queries:
- droplets_get_backup_policy
- droplets_list_backup_policies
The response will be a JSON object with a key called policy. This will be
set to a JSON object that contains the standard Droplet backup policy attributes.
| Name | Datatype | Description |
|---|---|---|
droplet_id | integer | The unique identifier for the Droplet. |
backup_enabled | boolean | A boolean value indicating whether backups are enabled for the Droplet. |
backup_policy | object | An object specifying the backup policy for the Droplet. |
next_backup_window | object | An object containing keys with the start and end times of the window during which the backup will occur. |
A JSON object with a policies key set to a map. The keys are Droplet IDs and the values are objects containing the backup policy information for each Droplet.
| Name | Datatype | Description |
|---|
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
droplets_get_backup_policy | select | droplet_id | To show information about an individual Droplet's backup policy, send a GET request to /v2/droplets/$DROPLET_ID/backups/policy. | |
droplets_list_backup_policies | select | per_page, page | To list information about the backup policies for all Droplets in the account, send a GET request to /v2/droplets/backups/policies. |
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_get_backup_policy
- droplets_list_backup_policies
To show information about an individual Droplet's backup policy, send a GET
request to /v2/droplets/$DROPLET_ID/backups/policy.
SELECT
droplet_id,
backup_enabled,
backup_policy,
next_backup_window
FROM digitalocean.compute.droplet_backup_policies
WHERE droplet_id = '{{ droplet_id }}' -- required
;
To list information about the backup policies for all Droplets in the account,
send a GET request to /v2/droplets/backups/policies.
SELECT
*
FROM digitalocean.compute.droplet_backup_policies
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;