Adds tags to keys or secrets.
Operation description
You can add multiple tags to multiple keys or multiple secrets at a time.
Debugging
Authorization information
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | Yes | The region ID of the resource. Note
You can call the DescribeRegions to query the most recent region list.
| cn-hangzhou |
| ResourceType | string | Yes | The type of the resource to which you want to add tags. Valid values:
| key |
| ResourceId | array | Yes | The IDs of the resources to which you want to add tags. You can enter a maximum of 50 resource IDs. Enter multiple resource IDs in the | |
| string | Yes | The IDs of the resources to which you want to add tags. You can enter a maximum of 50 resource IDs. Enter multiple resource IDs in the | key-hzz62f1cb66fa42qo**** | |
| Tag | array<object> | Yes | A list of tags. You can enter up to 20 tags. A tag consists of a key-value pair. Enter multiple tags in the | |
| object | Yes | |||
| Key | string | No | The key of the tag. A tag consists of a key-value pair. You can enter up to 20 tags. Enter multiple tags in the Each key can be up to 128 characters in length and can contain letters, digits, forward slashes (/), backslashes (\), underscores (_), hyphens (-), periods (.), plus signs (+), equal signs (=), colons (:), and at signs (@). Note
The key cannot start with aliyun or acs:.
| disk-encryption |
| Value | string | No | The value of the tag. A tag consists of a key-value pair. You can enter up to 20 tags. Enter multiple tags in the Each value can be up to 128 characters in length and can contain letters, digits, forward slashes (/), backslashes (\), underscores (_), hyphens (-), periods (.), plus signs (+), equal signs (=), colons (:), and at signs (@). | true |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "598d0219-45cd-4477-84ad-85a52d9debcf"
}Error codes
| HTTP status code | Error code | Error message |
|---|---|---|
| 400 | InvalidParameter.TagValue | The specified parameter is not valid. |
| 400 | InvalidParameter.TagKey | The specified parameter is not valid. |
| 400 | Duplicate.TagKey | The specified tagKey is duplicate. |
| 404 | InvalidAccessKeyId.NotFound | The Access Key ID provided does not exist in our records. |
| 404 | InvalidResourceId.NotFound | The specified ResourceId is not found. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2023-05-30 | The Error code has changed | View Change Details |
