Call ListTagResources to query the available resource label relationships.

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 header

Request syntax

GET /openapi/tags HTTPS|HTTP

Request parameters

Parameter Type Required Example Description
ResourceType String Yes INSTANCE

The type of the resource.

Page Integer No 1

The page number of the returned page.

NextToken String No 1d2db86sca4384811e0b5e8707e******

The token used to start the next query.

Size Integer No 10

The size.

ResourceIds String No ["es-cn-aaa","es-cn-bbb"]

The list of instance IDs that you want to query.

Tags String No [{"key":"env","value","dev"},{"key":"dev", "value":"IT"}]

The list of tags to be queried. The list is a JSON-formatted string that contains up to 20 sub-items.

  • Parameter ResourceIds and Tags you must select one of them to pass in the certificate. Otherwise, the exception message is prompted.
  • Only information of visible tags are returned.

Response parameters

Parameter Type Example Description
RequestId String F99407AB-2FA9-489E-A259-40CF6D******

The ID of the request.

PageSize Integer 1

Number of pages.

Headers Struct

The header of the response.

X-Total-Count Integer 10

The number of resources that can be queried through TagResource.

TagResources Struct

The group of tags and resources.

TagResource Array

The tag returned for the specified resource.

resourceId String es-cn-0xl0d06q9000b****

The ID of the instance.

resourceType String ALIYUN::ELASTICSEARCH::INSTANCE

The type of the resource.

tagKey String env

The key of the returned tag.

tagValue String dev

The value of the returned tag.

Examples

Sample requests

GET /consoleapi/tags?
ResourceIds=["es-cn-0xl0d06q9000b****","es-cn-xxx"]
&ResourceType=INSTANCE
&Tags=[{"key":"env","value":"dev"},{"key":"dep","value":"IT"}]

Sample success responses

XML format

<RequestId>3D8795D9-8FF5-46B2-86E6-E3B4073169BE</RequestId>
<TagResources>
    <TagResource>
        <ResourceType>ALIYUN::ELASTICSEARCH::INSTANCE</ResourceType>
        <ResourceId>es-cn-0xl0d06q9000****</ResourceId>
        <TagKey>env</TagKey>
        <TagValue>dev</TagValue>
    </TagResource>
</TagResources>

JSON format

{
    "RequestId": "3D8795D9-8FF5-46B2-86E6-E3B4073169BE",
    "TagResources": {
        "TagResource": [
            {
                "ResourceType": "ALIYUN::ELASTICSEARCH::INSTANCE",
                "ResourceId": "es-cn-0xl0d06q9000****",
                "TagKey": "env",
                "TagValue": "dev"
            }
        ]
    }
}

Error codes

HTTP status code Error code Error message Description
401 UserUnauthorized Authentication required The error message returned because you are not authorized to perform the operation. Please log on to the console and check whether you have the required permission.
401 SubAccountNoPermission Aliyun sub account has no permission, please authorize your sub account in Aliyun RAM The error message returned because the RAM user does not have the required permission. Please check the permissions of the RAM user.

For a list of error codes, visit the API Error Center.