Adds tags to one or more keys or secrets.
Operation description
You can add multiple tags to multiple keys or multiple secrets at a time.
For more information about the access policy required by a RAM user or RAM role to call this API, see Resource Access Management.
Try it now
Test
RAM authorization
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 |
No |
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 |
No |
|||
| 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 elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
598d0219-45cd-4477-84ad-85a52d9debcf |
Examples
Success response
JSON format
{
"RequestId": "598d0219-45cd-4477-84ad-85a52d9debcf"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.