VMware {code} Community
conchaji
Contributor
Contributor

Retreive VM TAGs association via VMware SOAP API

Hi,

We need to retreive VM Tags via VMware SOAP API.

Through the SOAP API we have been able to retrieve all the information related to the VMs that we needed (querying Managed Object - HostSystem), including the "custom attributes" except for the TAGs (we need to read the tag association of VMs)

The information that we found in different sources states that the vSphere API TAGs are not the same TAGs as seen in the vSphere Web Client so the Web Client TAGs are actually stored and managed by the Inventory Service, separate from the vSphere API (and database) and currently the only official version for managing / reading the vSphere Web Client Tags is either using the Web Client or the PowerCLI.

However, this information is not too clear or precise (we have also found some documents in which methods are mentioned through pyvmomi).

Is there a way to read TAGS association with VMs using the SOAP API?

Thank you Best regards

1 Reply
doskiran
Enthusiast
Enthusiast

Use VMware common infrastructure services REST APIs( CIS APIs) for Tags.
APIs to create, manage, and enumerate tags & categories also query the attached tags and attached objects.

Ref: https://developer.vmware.com/apis/vsphere-automation/latest/cis/tagging/tag_association/

 

Reply
0 Kudos