Create Category
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.
Creates a category. To invoke this operation, you need the create category privilege.
Request
URLURL
https://{api_host}/rest/com/vmware/cis/tagging/category
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
TaggingCategoryCreateRequestBody of type application/json (required){
"create_spec": {
"associable_types": [
"string"
],
"cardinality": "enum",
"description": "string",
"name": "string"
}
}
Response
Response
Response BodyResponse Body
200 OK returns
TaggingCategoryCreateResponseBody
of type application/json
The identifier of the created category. The result will be an identifier for the resource type: com.vmware.cis.tagging.Category.
{
"value": "string"
}
string
value
Optional
The identifier of the created category. The result will be an identifier for the resource type: com.vmware.cis.tagging.Category.
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" -H "Content-Type: application/json" -d '{"create_spec":{"associable_types":["string"],"cardinality":"enum","category_id":"string","description":"string","name":"string"}}' https://{api_host}/rest/com/vmware/cis/tagging/category
Errors
400
com.vmware.vapi.std.errors.invalid_argument : if any of the information in the createSpec is invalid.
401
com.vmware.vapi.std.errors.unauthorized : if you do not have the privilege to create a category.
409
com.vmware.vapi.std.errors.already_exists : if the Category.CreateSpec.name provided in the createSpec is the name of an already existing category.
On This Page
Category Operations
get
post
get
patch
delete