pydo.droplets.list_backup_policies()

Description

To list information about the backup policies for all Droplets in the account, send a GET request to /v2/droplets/backups/policies.

Parameters

Name Type Required Description Default Value
per_page integer False Number of items returned per page 20
page integer False Which ‘page’ of paginated results to return. 1

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

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.

Click to expand an example response.
{
  "policies": {
    "436444618": {
      "droplet_id": 436444618,
      "backup_enabled": false
    },
    "444909314": {
      "droplet_id": 444909314,
      "backup_enabled": true,
      "backup_policy": {
        "plan": "daily",
        "hour": 20,
        "window_length_hours": 4,
        "retention_period_days": 7
      },
      "next_backup_window": {
        "start": "2024-09-13T20:00:00Z",
        "end": "2024-09-14T00:00:00Z"
      }
    },
    "444909706": {
      "droplet_id": 444909706,
      "backup_enabled": true,
      "backup_policy": {
        "plan": "weekly",
        "weekday": "SUN",
        "hour": 20,
        "window_length_hours": 4,
        "retention_period_days": 28
      },
      "next_backup_window": {
        "start": "2024-09-15T20:00:00Z",
        "end": "2024-09-16T00:00:00Z"
      }
    }
  },
  "links": {},
  "meta": {
    "total": 3
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}