pydo.snapshots.list()
Generated on 1 May 2025
from pydo
version
v0.11.0
Description
To list all of the snapshots available on your account, send a GET request to
/v2/snapshots
.
The response will be a JSON object with a key called snapshots
. This will be
set to an array of snapshot
objects, each of which will contain the standard
snapshot attributes.
Filtering Results by Resource Type
It’s possible to request filtered results by including certain query parameters.
List Droplet Snapshots
To retrieve only snapshots based on Droplets, include the resource_type
query parameter set to droplet
. For example, /v2/snapshots?resource_type=droplet
.
List Volume Snapshots
To retrieve only snapshots based on volumes, include the resource_type
query parameter set to volume
. For example, /v2/snapshots?resource_type=volume
.
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 |
resource_type |
string | False | Used to filter snapshots by a resource type. |
Request Sample
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
resp = client.snapshots.list()
More Information
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.