REST API - list

vcenter tags VM: list

Returns information about the tags that are associated with virtual machines on this vCenter Server, where the tags need to match vcenter.tags.VM.filter_spec. Warning: This operation is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Request:

HTTP request

GET https://{server}/rest/vcenter/tags/vm

?filter.tags.1=obj-103
&filter.tags.2=obj-103

Request Query Parameters:

Name Type Description
bold = required
filter filter_spec Optional. The specification of matching tag associations.
filter.tags string[] Tag associations need to have one of the tag identifiers in this set to match the filter. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. If unset or empty, returns all tag associations.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: com.vmware.cis.tagging.Tag:VirtualMachine. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: com.vmware.cis.tagging.Tag:VirtualMachine.

Response:

HTTP Status Code: 200

Representation:

{
    "value"{
        "tags"[
            {
                "count"1,
                "tag""obj-103"
            },
            {
                "count"1,
                "tag""obj-103"
            }
        ]
    }
}

Response Type:

Name Type Description
bold = required
value list_result ListResult with list of tag summaries, see vcenter.tags.VM.list_result.
value.tags summary[] The list of tag summaries. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

value.tags[].tag string The identifier of a tag. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.cis.tagging.Tag:VirtualMachine. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.cis.tagging.Tag:VirtualMachine.

value.tags[].count long Number of virtual machines associated with the tag. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Errors:

HTTP Status Code Type Description
403 unauthorized if the user doesn't have the required privileges.