This API is used to add or delete tags for a specified resource in batches.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID. |
resource_id |
Yes |
String |
Specifies the resource ID. |
Request parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
tags |
Yes |
Specifies the tag list. |
|
action |
Yes |
String |
Specifies the operation to be performed. The value can be set to create or delete only. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Specifies the key. It contains a maximum of 36 Unicode characters. The key value must comply with Character Set Specifications. |
value |
Mandatory if action is create and optional if action is delete. |
String |
Specifies the value. Each value contains a maximum of 43 Unicode characters. When tags are being deleted and some tags do not exist, the operation is considered successful by default, and the character set of the tags will not be checked upon deletion. When tags are deleted, the tag structure body cannot be missing, and the key cannot be left blank or set to an empty string. The value must comply with Character Set Specifications. |
Response parameters
None
The following examples describe how to create or delete a tag.
{ "action": "create", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key", "value": "value3" } ] }
or
{ "action": "delete", "tags": [ { "key": "key1" }, { "key": "key2", "value": "value3" } ]}
For details about error status codes, see Status Codes.