This API has a deprecated equivalent from v7.0U1.
Attach Tag To Multiple Objects Tag Association
Attaches the given tag to the input objects. If a tag is already attached to the object, then the individual operation is a no-op and an error will not be added to TagAssociation.BatchResult.error-messages. To invoke this operation, you need the attach tag privilege on the tag and the read privilege on each object.
Request
URLURL
https://{api_host}/api/cis/tagging/tag-association/{tag_id}?action=attach-tag-to-multiple-objects
Path Parameters
Path Parameters
string
tag_id
Required
The identifier of the input tag.
The parameter must be an identifier for the resource type: com.vmware.cis.tagging.Tag.
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, obtained by first calling Create Session API
Request Body
Request Body
TaggingTagAssociationAttachTagToMultipleObjectsRequestBody of mimetype application/json
Optional
This is a request body class for an operation.
(The request body parameter is missing description)
{
"object_ids": [
{
"id": "string",
"type": "string"
}
]
}
Response
Response
Response BodyResponse Body
200 OK returns
TaggingTagAssociationBatchResult of type application/json
The outcome of the batch operation and the list of error messages (TagAssociation.BatchResult.error-messages) describing attachment failures.
{
"error_messages": [
{
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": {
"key": {
"d": 0,
"dt": "string",
"format": "enum",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
}
],
"success": false
}
boolean
success
Required
This is true if the batch operation completed without any errors. Otherwise it is false and all or some operations have failed.
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" -H "Content-Type: application/json" -d '{}' https://{api_host}/api/cis/tagging/tag-association/{tag_id}?action=attach-tag-to-multiple-objects
Errors
403
com.vmware.vapi.std.errors.unauthorized : if you do not have the attach tag privilege on the tag.
404
com.vmware.vapi.std.errors.not_found : if the tag for the given tagId does not exist in the system.
Availability
Added in 7.0U2