#Add tag/annotate a volume in ontap
1 messages · Page 1 of 1 (latest)
With the REST API there is, so I'd assume you just need to convert that to python.
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 🙂
Copyright © 2024 NetApp Inc.
All rights reserved …
Copyright © 2024 NetApp Inc.
All rights reserved …
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
I have found that you can create a tag using resource tag and fetch it via volumes API field _tags. Thank you all