-
Notifications
You must be signed in to change notification settings - Fork 313
Open
Labels
Description
- I am using the latest SDK version
- This API is compatible with my vCenter version (You can get the info from 'vcenter_version' in each sample)
- I have searched existing issues and Troubleshooting wiki
Environment
- sdk package version:
- python version:
Python 3.7.4
-
vSphere version:
7 -
Operating System/Shell (used to run SDK-based apps):
macOS
Steps or code snippet to reproduce
from vmware.vapi.vsphere.client import create_vsphere_client
import requests
from com.vmware.vapi.std_client import DynamicID
import urllib3
urllib3.disable_warnings()
session = requests.Session()
session.verify = False
hostname = "10.65.201.153"
username = "[email protected]"
password = "Esxi@123$%"
client = create_vsphere_client(server=hostname,
username=username,
password=password,
session=session)
tag_svc = client.tagging.Tag
tag_ass_svc = client.tagging.TagAssociation
tags = []
cluster_id = 'domain-c9'
cls_dynamic_id = DynamicID(type='ComputeClusterResource', id=cluster_id) # This is wrong type, it should be ClusterComputeResource
tag_ids = tag_ass_svc.list_attached_tags(cls_dynamic_id)
for tag_id in tag_ids:
tags.append(tag_svc.get(tag_id))
print(tags)
Actual behavior
[]
Expected behavior
[TagModel(id='urn:vmomi:InventoryServiceTag:0deaa3f7-a91e-4c20-bf19-f15201c49ec2:GLOBAL', category_id='urn:vmomi:InventoryServiceCategory:ca46a635-5e0c-47e9-a4c1-9682ac281928:GLOBAL', name='tag_0001', description='', used_by=set())]