As a prerequisite to dynamically populating tag data through the API, this section provides some examples of using the vRealize Automation IaaS API return tags and filters to return suitable tags based on known keys.
Get All Tags
Return a list of all available tags, keys and values.
GET /iaas/api/tags
Filter Tags by Key
Return all available tags with a key of location. For example the tag can return the location:newyork
and location:sydney
values. The core element in this example is that you can return all relevant tags based on your defined key.
GET /iaas/api/tags?$filter=key eq 'location’
Filter Networks by Tag Key and Value
Filter networks based on the key and value to then find suitable subsequent tags for further filtering.
GET /iaas/api/fabric-networks?$filter=tags.item.key eq 'environment' and tags.item.value eq 'dev’
Filter Networks by Cloud Account ID and Environment
Filter networks based on cloud account ID and tag key and value, this can be used when you have different placement logic between public cloud and on-premises deployments to display the relevant tags for the target cloud.
GET /iaas/api/fabric-networks?$filter=cloudAccountIds.item eq 'ec4822a755a755906c6b3822b2' and tags.item.key eq 'environment’ and tags.item.value eq 'dev'