Creates tags and adds the tags to resources at a time.
Debugging
Request headers
This operation uses only the common request header. For more information, see the topic about common request parameters.
Request syntax
POST /pop/v5/tag/tags HTTP/1.1
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
ResourceIds | String | Query | Yes | ["000e5836-xxxx-xxxx-xxxx-0d6ab2ac4877"] |
The IDs of the resources. The value must be 1 to 20 characters in length. Set this parameter to a JSON array. |
ResourceRegionId | String | Query | Yes | cn-hangzhou |
The ID of the region where the resources reside. |
ResourceType | String | Query | Yes | application |
The type of the resources. Valid values:
|
Tags | String | Query | Yes | [{"key":"key1","value":"v1"},{"key":"key2","value":"v2"}] |
The key-value pairs. When you set this parameter, take note of the following limits:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | Integer | 200 |
The HTTP status code. |
Message | String | success |
The returned message that indicates whether the request is successful. |
RequestId | String | 000e5836-xxxx-xxxx-xxxx-0d6ab2ac4877 |
The unique ID of the request. |
Examples
Sample requests
POST /pop/v5/tag/tags HTTP/1.1
Common request header
{
"ResourceIds": "["000e5836-xxxx-xxxx-xxxx-0d6ab2ac4877"]",
"ResourceRegionId": "cn-hangzhou",
"ResourceType": "application",
"Tags": "[{"key":"key1","value":"v1"},{"key":"key2","value":"v2"}]"
}
Sample success responses
XML
format
<Message>success</Message>
<RequestId>000e5836-xxxx-xxxx-xxxx-0d6ab2ac4877</RequestId>
<Code>200</Code>
JSON
format
{
"Message": "success",
"RequestId": "000e5836-xxxx-xxxx-xxxx-0d6ab2ac4877",
"Code": 200
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
500 | Edas.errorcode.InstanceNotExist.Instance.message | The instance does not exist. | The error message returned because the specified instance does not exist. |
For a list of error codes, visit the API Error Center.