Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to add a tag/annotation to existing volume using Python API
2025-02-05
12:36 PM
802 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Community,
Do we have a way to patch volume with a tag or annotation. Ideally i'm looking for something like this to work. I"m looking to see anything other than "comment" field.
>>> with HostConnection(host,username=username,password=password, verify=False):
... volume = Volume(uuid=volume_uuid)
... volume.tags = ["high-priority", "backup"]
... volume.patch()
... volume.get()
... print(volume.to_dict())
$ /usr/bin/pip3 show netapp-ontap
Name: netapp-ontap
Version: 9.12.1.0
Kalyan
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think Version 13 and up support tags.
from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
resource.tiering.object_tags = ["key1=val1", "key2=val2"]
resource.patch()
