Does the API provide a method to list all snapshots with their details?
GET https://api.digitalocean.com/v2/images/<snapshot-id> responds correctly with snapshot details of the specified snapshot-id.
But how to get a list of snapshots?
GET https://api.digitalocean.com/v2/images/ responds with a list of all images but it does not seem to include snapshots.
Is there a way to list all snapshots with their details?
Since snapshot ids are listed in a droplet’s info, one solution to the question would be to first GET all droplets, extract all snapshot ids and then make multiple GET requests for each snapshot’s details.
Just checking if there’s a direct way to list all snapshots with their details.
Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
https://api.digitalocean.com/v2/images/ does appear to list snapshots for me, backups, images and snapshots are all being listed.
The /images call does list all snapshots. Make sure you’ve covered all the pages as the response is paginated. For example, here’s the response I got:
{
"images": [
"..."
],
"links": {
"pages": {
"last": "https://api.digitalocean.com/v2/images?page=2",
"next": "https://api.digitalocean.com/v2/images?page=2"
}
},
"meta": {
"total": 39
}
}
As you said /images correctly list all images including snapshots.
I wasn’t checking for pagination.
Thanks for your replies.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.