Attach Tag To Multiple Objects Tag Association
Released in v6.5Attaches 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}/rest/com/vmware/cis/tagging/tag-association/id:{tag_id}?~action=attach-tag-to-multiple-objects
Parameters
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, acquired from Create Session API under CIS product
vmware-api-session-id Example
b00db39f948d13ea1e59b4d6fce56389
Request Body
Request Body
TaggingTagAssociationAttachTagToMultipleObjectsRequestBody of type application/json (required){
"object_ids": [
{
"id": "string",
"type": "string"
}
]
}
Response
Response
Response BodyResponse Body
200 OK returns
TaggingTagAssociationAttachTagToMultipleObjectsResponseBody
of type application/json
The outcome of the batch operation and the list of error messages (TagAssociation.BatchResult.error-messages) describing attachment failures.
{
"value": {
"error_messages": [
{
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": [
{
"key": "key1",
"value": {
"d": 0,
"dt": "string",
"format": "enum",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
]
}
],
"success": false
}
}
value
Optional
The outcome of the batch operation and the list of error messages (TagAssociation.BatchResult.error-messages) describing attachment failures.
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" -H "Content-Type: application/json" -d '{}' https://{api_host}/rest/com/vmware/cis/tagging/tag-association/id:{tag_id}?~action=attach-tag-to-multiple-objects
Errors
401
com.vmware.vapi.std.errors.unauthorized : if you do not have the attach tag privilege on the tag. | com.vmware.vapi.std.errors.unauthenticated : if the user can not be authenticated.
404
com.vmware.vapi.std.errors.not_found : if the tag for the given tagId does not exist in the system.
default
'Default' means this response is used for all HTTP codes that are not covered individually for this operation.