VMWARE rest api tag association -
i'm trying associate vmware tags vitual machines on rest api vsphere 6.5. api documentation method lacking: https://vdc-repo.vmware.com/vmwb-repository/dcr-public/1cd28284-3b72-4885-9e31-d1c6d9e26686/71ef7304-a6c9-43b3-a3cd-868b2c236c81/doc/operations/com/vmware/cis/tagging/tag_association.attach-operation.html
in particular i'm struggling find information on object id type , should passed 2 ids (different sources give different answers). information on formats , content of these fields appreciated.
this current post. ids being pulled api during virtual machine creation.
post /rest/com/vmware/cis/tagging/tag-association/id:urn:vmomi:inventoryservicetag:<hex number>:global?~action=attach json encoded body:
{"object_id":{"id":"elstree_vm-<4 digit number>","type":"virtualmachine"}} the api returning 404s , error tagging object not found, of type cis.tagging.objectnotfound.error.
worked out
the correct post format:
post /rest/com/vmware/cis/tagging/tag-association/id:urn:vmomi:inventoryservicetag:<hex number>:global?~action=attach json encoded body
{"object_id":{"id":"vm-<4 digit number>","type":"virtualmachine"}}
Comments
Post a Comment