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",
        "tag_id""obj-103"
    }
}

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.

create_spec.tag_id string This attribute was added in vSphere API 6.7

Optional. 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.

Response:

HTTP Status Code: 200

Representation:

{
    "value""obj-103"
}

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.