Detach Tag From Multiple Objects Tag Association
If vSphere APIs begin with /rest (vs /api), any maps are consumed/returned instead as arrays of objects, each containing a key and a value property field.
Detaches the given tag from the input objects. If a tag is already removed from 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=detach-tag-from-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, obtained by first calling Create Session API
Example: b00db39f948d13ea1e59b4d6fce56389
Request Body
Request Body
TaggingTagAssociationDetachTagFromMultipleObjectsRequestBody of type application/json (required){}
array of
Std_DynamicID
object_ids
Required
The identifiers of the input objects.
Response
Response
Response BodyResponse Body
200 OK returns
TaggingTagAssociationDetachTagFromMultipleObjectsResponseBody
of type application/json
The outcome of the batch operation and the list of error messages (TagAssociation.BatchResult.error-messages) describing detachment failures.
{
"value": {
"success": false
}
}
value
Optional
The outcome of the batch operation and the list of error messages (TagAssociation.BatchResult.error-messages) describing detachment 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=detach-tag-from-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 tag does not exist in the system.