ramjashnani7
Contributor
Contributor

API to access vCenter Inventory Service Managed Object

I am aware that using the APIs mentioned here (https://developer.vmware.com/apis/vsphere-automation/v7.0.0/cis/tagging/) I can add, create, update, get all tags and categories associated with objects. But the response of these APIs contains a resource identifier instead of the tag name or its metadata. 

I found an article which explains step by step on how can I find the tag name or its details using the identifier received in the API response and this requires navigating to the vCenter's Inventory service Managed object browser. I was wondering if I can access this inventory service through APIs as my usecase requires to fetch all associated tags with an object but the REST API mentioned above returns only the identifiers and not the actual tag name. If so, can someone share the APIs names or links to any associated articles. 

Thanks.

Tags (3)
0 Kudos
1 Reply
lamw
Community Manager
Community Manager

The vSphere Tagging API (CIS) is all that you need for all CRUD and GET operations.

If you wish to retrieve the Name/Description, you just perform a GET on the TAG ID

e.g.

https://vcsa.primp-industries.local/api/cis/tagging/tag/urn:vmomi:InventoryServiceTag:6a5eb4ea-d592-4365-9c3f-880ba3a4ef44:GLOBAL

Another useful tool to play w/vSphere REST API without having to write any code is Developer Center (built into vCenter Server via vSphere UI)

0 Kudos