Creates tags and adds the tags to resources at a time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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:

  • application: Enterprise Distributed Application Service (EDAS) application
  • cluster: EDAS cluster
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:

  • You can add up to 20 tags to a resource.
  • The key cannot start with aliyun or acs: and cannot contain http:// or https://.
  • The tag key or tag value can be up to 128 characters in length, and can contain letters, digits, hyphens (-), commas (,), asterisks (*), forward slashes (/), question marks (?),and colons (:).
  • Set this parameter to a JSON array.

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.