#Add tag/annotate a volume in ontap

1 messages · Page 1 of 1 (latest)

cloud edge
#

Hey everyone , is there a way to add a volume tag/annotate with ontap python api ? I’m looking for to see if there is anything other than comment that can be used as metadata

teal raven
prime coral
#

volumes have a tags property that contains a list of tags. You can do a PATCH on that property to add new tags.
https://library.netapp.com/ecmdocs/ECMLP3331665/html/resources/volume.html
Keep in mind that if you already have some tags and want to add new ones, the new value of tags in the patch request should include all previous tags + new ones if you want to keep the old ones. Otherwise, old ones will be overwritten.

Another way to create tags is using a separate endpoint where you pass the href of the resource you want to tag, and the tag value of your choosing.
https://library.netapp.com/ecmdocs/ECMLP3331665/html/resources/resource_tag_resource.html

I hope this helps 🙂

cloud edge
#

Thank you but this doesn’t seem to be very intuitive using href. Shouldn’t it be simple like using volume name or volume uuid directly . Also, calling another API to get tags for a volume seems extra . I have been already fetching volume info using volume api and now need to call another APi to get volume metadata seems extensive

cloud edge
#

I have found that you can create a tag using resource tag and fetch it via volumes API field _tags. Thank you all