Adds one or more tags to specified resources.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:TagResources |
*All Resource
|
None | None |
Request syntax
POST /tags HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-beijing |
| ResourceType |
string |
Yes |
The resource type. Only |
application |
| Tags |
string |
No |
The key-value pairs of the tags. This parameter is required unless you specify the ResourceIds parameter. The following rules apply:
Tags are case-sensitive. If you specify multiple tags, they are created and bound to the specified resources. For a single resource, each tag key must be unique. If you specify a tag key that already exists for a resource, the operation updates the existing tag value. A tag key cannot start with |
[{"key":"k1","value":"v1"}] |
| ResourceIds |
string |
Yes |
The resource IDs. You can specify up to 50 resource IDs in a JSON array. This parameter is required unless you specify the Tags parameter. |
["d42921c4-5433-4abd-8075-0e536f8b****"] |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| RequestId |
string |
The request ID. |
91F93257-7A4A-4BD3-9A7E-2F6EAE6D**** |
| Message |
string |
The additional information returned.
|
success |
| TraceId |
string |
The trace ID that you can use to query the details of the request. |
0a98a02315955564772843261e**** |
| Data |
boolean |
Indicates whether the operation was successful. |
true |
| ErrorCode |
string |
The error code.
|
|
| Code |
string |
The HTTP status code. Valid values:
|
200 |
| Success |
boolean |
Indicates whether the tags were added to the resources. Valid values:
|
true |
Examples
Success response
JSON format
{
"RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
"Message": "success",
"TraceId": "0a98a02315955564772843261e****",
"Data": true,
"ErrorCode": "",
"Code": "200",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Duplicate.TagKey | The TagKey contains duplicate keys. | |
| 400 | InvalidParameter.TagKey | The specified TagKey is invalid. | |
| 400 | InvalidParameter.TagValue | The specified TagValue is invalid. | |
| 400 | Missing.TagKey | You must specify TagKey. | |
| 400 | NumberExceed.Tags | The maximum number of tags is exceeded. | |
| 400 | InvalidResourceType.NotFound | The specified resource type is not supported. | |
| 400 | InvalidParameter.Obviously | The specified parameter is invalid {%s}. | |
| 400 | NumberExceed.ResourceIds | The number of resource IDs cannot exceed 50. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.