REST API - list_attached_tags_on_objects

cis tagging tag association: list attached tags on objects

Fetches the array of cis.tagging.tag_association.object_to_tags describing the input object identifiers and the tags attached to each object. To invoke this operation, you need the read privilege on each input object. The cis.tagging.tag_association.object_to_tags.tag_ids will only contain those tags for which you have the read privilege. This operation was added in vSphere API 6.5.

Request:

HTTP request

POST https://{server}/rest/com/vmware/cis/tagging/tag-association?~action=list-attached-tags-on-objects

Request Body Structure:

{
    "object_ids"[
        {
            "id""obj-103",
            "type""string"
        },
        {
            "id""obj-103",
            "type""string"
        }
    ]
}

Request Body Parameters:

Name Type Description
bold = required
object_ids dynamic_ID[] The identifiers of the input objects.
object_ids[].type string The type of resource being identified (for example com.acme.Person).

Services that contain operations for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata services include a service that allows retrieving all the known resource types.

object_ids[].id string The identifier for a resource whose type is specified by vapi.std.dynamic_ID.type.

When clients pass a value of this structure as a parameter, the field type must contain the actual resource type. When operations return a value of this structure as a result, the field type will contain the actual resource type.

Response:

HTTP Status Code: 200

Representation:

{
    "value"[
        {
            "tag_ids"[
                "obj-103",
                "obj-103"
            ],
            "object_id"{
                "id""obj-103",
                "type""string"
            }
        },
        {
            "tag_ids"[
                "obj-103",
                "obj-103"
            ],
            "object_id"{
                "id""obj-103",
                "type""string"
            }
        }
    ]
}

Response Type:

Name Type Description
bold = required
value object_to_tags[] The array of the object identifiers to all tag identifiers that are attached to that object.
value[].object_id dynamic_ID The identifier of the object. This attribute was added in vSphere API 6.5.

value[].object_id.type string The type of resource being identified (for example com.acme.Person).

Services that contain operations for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata services include a service that allows retrieving all the known resource types.

value[].object_id.id string The identifier for a resource whose type is specified by vapi.std.dynamic_ID.type.

When clients pass a value of this structure as a parameter, the field type must contain the actual resource type. When operations return a value of this structure as a result, the field type will contain the actual resource type.

value[].tag_ids string[] The identifiers of the related tags. This attribute was added in vSphere API 6.5.

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. 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.

Errors:

HTTP Status Code Type Description
401 unauthenticated if the user can not be authenticated.