Create Category
Creates a category. To invoke this operation, you need the create category privilege.
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 category to be created.
{
"associable_types": [
"string"
],
"cardinality": "SINGLE",
"description": "string",
"name": "string"
}
Object types to which this category’s tags can be attached.
The CategoryModel.Cardinality enumerated type defines the number of tags in a category that can be assigned to an object.
SINGLE : An object can only be assigned one of the tags in this category. For example, if a category is “Operating System”, then different tags of this category would be “Windows”, “Linux”, and so on. In this case a VM object can be assigned only one of these tags and hence the cardinality of the associated category here is single.
MULTIPLE : An object can be assigned several of the tags in this category. For example, if a category is “Server”, then different tags of this category would be “AppServer”, “DatabaseServer” and so on. In this case a VM object can be assigned more than one of the above tags and hence the cardinality of the associated category here is multiple.
Possible values are: SINGLE , MULTIPLE
The description of the category.
The display name of the 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.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.
Authentication
Response
Response BodyResponse Body
The identifier of the created category. The result will be an identifier for the resource type: com.vmware.cis.tagging.Category.
Errors
com.vmware.vapi.std.errors.already_exists : if the Category.CreateSpec.name provided in the createSpec is the name of an already existing category. | com.vmware.vapi.std.errors.invalid_argument : if any of the information in the createSpec is invalid.
com.vmware.vapi.std.errors.unauthorized : if you do not have the privilege to create a category.
‘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/category
x-vmw-doc-operation: create