Report this

What is the reason for this report?

Is it possible to tag a snapshot using the API?

Posted on December 3, 2019

I see that in the snapshots API, there is a list of “tags” per snapshot.

Is it possible to add a tag to a snapshot using the API? Also, is it possible to fetch all the snapshots with a certain tag?



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @firedragondol, sorry for the confusion. You can tag Droplet Snapshots via the API - they’re considered an image, so you would pass “resource_type”:“image”

Hope this helps!

Hey, yes you can do it for Volumes and Snapshots of Volumes but not for Droplet Snapshot at this moment.

A Tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it.

https://developers.digitalocean.com/documentation/v2/#tags

Hello,

As far as I can see this is supported. According to the official documentation currently tagging of Droplets, Images, Volumes, and Volume Snapshots is supported.

You could take a look at this part of the API documentation in order to see the exact request that you need in order to do that:

https://developers.digitalocean.com/documentation/v2/#tag-a-resource

Regarding retrieving by tag, you could take a look at this part of the documentation:

https://developers.digitalocean.com/documentation/v2/#retrieve-a-tag

Hope that this helps! Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.