Adding or Deleting Cluster Tags in Batches

Function

This API is used to add or delete tags to or from a specified cluster in batches.

You can add a maximum of 10 tags to a cluster.

This API is idempotent.

URI

Request

Table 2 Request parameter description

Parameter

Mandatory

Type

Description

action

Yes

String

Operation to be performed. The value can be set to create or delete only.

tags

Yes

List<resource_tag>

Tag list. For details about the parameter, see Table 3.

Table 3 tags parameter description

Parameter

Mandatory

Type

Description

key

Yes

String

Key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).

value

Yes

String

Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).

Note:

  • This parameter is mandatory for adding a tag.
  • This parameter is optional for deleting a tag.

Response

Response parameters

None.

Example

{ 
    "action": "create", 
    "tags": [ 
        { 
            "key": "key1", 
            "value": "value1" 
        }, 
        { 
            "key": "key", 
            "value": "value3" 
        } 
    ] 
} 

Status Code

Table 4 describes the status code of this API.

Table 4 Status code

Status Code

Description

204

The operation is successful.