cis tagging tag: create
Creates a tag. To invoke this operation, you need the create tag privilege on the input category.
Request:
HTTP request
POST https://{server}/rest/com/vmware/cis/tagging/tag
Request Body Structure:
{
"create_spec": {
"category_id": "obj-103",
"description": "string",
"name": "string"
}
}
"create_spec": {
"category_id": "obj-103",
"description": "string",
"name": "string"
}
}
<?xml version="1.0" ?>
<ns0:Create-Input xmlns:ns0="http://vmware.com/cis/tagging/tag" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<create_spec>
<description>string</description>
<name>string</name>
<category_id>obj-103</category_id>
</create_spec>
</ns0:Create-Input>
<ns0:Create-Input xmlns:ns0="http://vmware.com/cis/tagging/tag" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<create_spec>
<description>string</description>
<name>string</name>
<category_id>obj-103</category_id>
</create_spec>
</ns0:Create-Input>
Request Body Parameters:
Name | Type | Description |
---|---|---|
bold = required | ||
create_spec | create_spec | Specification for the new tag to be created. |
create_spec.name | string | The display name of the tag. The name must be unique within its category. |
create_spec.description | string | The description of the tag. |
create_spec.category_id | 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 . |
Response:
HTTP Status Code: 200
Representations:
{
"value": "obj-103"
}
"value": "obj-103"
}
<?xml version="1.0" ?>
<ns0:Create-Result xmlns:ns0="http://vmware.com/cis/tagging/tag" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<value>obj-103</value>
</ns0:Create-Result>
<ns0:Create-Result xmlns:ns0="http://vmware.com/cis/tagging/tag" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<value>obj-103</value>
</ns0:Create-Result>
Response Type:
Name | Type | Description |
---|---|---|
bold = required | ||
value | string | The identifier of the created tag. |
Errors:
HTTP Status Code | Type | Description |
---|---|---|
400 | already_exists | if the cis.tagging.tag.create_spec.name provided in the create_spec is the name of an already existing tag in the input category. |
400 | invalid_argument | if any of the input information in the create_spec is invalid. |
404 | not_found | if the category for in the given create_spec does not exist in the system. |
403 | unauthorized | if you do not have the privilege to create tag. |