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?
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!
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
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.
To specify, I’d like to tag a droplet snapshot. A volume snapshot would be fine if it’s possible to take a snapshot of the default volume of a droplet (I don’t have any additional ones)