Create Tag
Creates a tag. To invoke this operation, you need the create tag privilege on the input category.
Request
URLURL
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
Specification for the new tag to be created.
{
"category_id": "string",
"description": "string",
"name": "string"
}
The unique identifier of the parent category in which this tag will be created. 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.Category. 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.Category.
The description of the tag.
The display name of the tag. The name must be unique within its category.
If unset an identifier will be generated by the server 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. 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.
Authentication
Response
Response BodyResponse Body
The identifier of the created tag. The result will be an identifier for the resource type: com.vmware.cis.tagging.Tag.
Errors
com.vmware.vapi.std.errors.already_exists : if the Tag.CreateSpec.name provided in the createSpec is the name of an already existing tag in the input category. | com.vmware.vapi.std.errors.invalid_argument : if any of the input information in the createSpec is invalid.
com.vmware.vapi.std.errors.not_found : if the category for in the given createSpec does not exist in the system.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
PowerCLI Client SDK All Parameters Example
cURL Command
Vendor Extensions
x-vmw-doc-deprecated-method: post
x-vmw-doc-deprecated-path: /rest/com/vmware/cis/tagging/tag
x-vmw-doc-operation: create