Queries the tags that are added to one or more resources.

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 common request headers. For more information, see Common request headers.

Request syntax

GET /openapi/tags HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
Page Integer Query No 1

The number of pages in the resource relationship list. Discarded fields.

Size Integer Query No 10

The number of entries on each page that is specified during a paged query. Discard fields.

ResourceType String Query Yes INSTANCE

The type of the resource.

NextToken String Query No 1d2db86sca4384811e0b5e8707e******

The token that determines the start point of the query.

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

The list of instance IDs that you want to query. Uses the JSON array format. A maximum of 20 sub-items are supported.

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

The list of tags to query. It is in the form of a JSON string and contains a maximum of 20 subitems.

  • You must specify at least one of the ResourceIds and Tags parameters. Otherwise, an error is returned.
  • You can only query visible tags in system tags, but not invisible tags.
    Note System tags are tags that are added to user instances by cloud products (Alibaba Cloud services). System tags include visible tags and invisible tags.

Response parameters

Parameter Type Example Description
PageSize Integer 1

The number of the returned page.

RequestId String F99407AB-2FA9-489E-A259-40CF6D******

The ID of the request.

Headers Object

The header of the response. This parameter is empty and is for reference only. You cannot force this parameter to be relied on in the program.

Note The return examples does not contain this parameter.
X-Total-Count Integer 10

The number of resources to query.

TagResources Object

A list of resources that have tags.

TagResource Array of TagResource

The labels of the resource.

TagValue String dev

The value of the tag.

ResourceType String ALIYUN::ELASTICSEARCH::INSTANCE

The type of the resource. Fixed to ALIYUN::ELASTICSEARCH::INSTANCE.

ResourceId String es-cn-oew1q8bev0002****

Indicates the ID of a resource.

TagKey String env

The tag key.

Examples

Sample requests

GET /openapi/tags?ResourceType=INSTANCE&NextToken=1d2db86sca4384811e0b5e8707e******&ResourceIds=["es-cn-aaa","es-cn-bbb"]&Tags=[{"key":"env","value","dev"},{"key":"dev",  "value":"IT"}] HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json

Sample responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "A5423B74-DBD5-4714-BF28-6725E5BE****",
  "TagResources" : {
    "TagResource" : [ {
      "ResourceType" : "ALIYUN::ELASTICSEARCH::INSTANCE",
      "ResourceId" : "es-cn-oew1q8bev0002****",
      "TagKey" : "env",
      "TagValue" : "dev"
    } ]
  }
}

Error codes

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