Queries tags. You can call the ListTagResources operation to query tags that are added to Auto Scaling resources, thereby clarifying resource utilization and facilitating efficient management. This operation aids in the automation of resource categorization and permission management processes.
Usage notes
Specify at least one of the following request parameters:
ResourceId.NandTag.N.Tag.N.KeyandTag.N.Valueare used to specify the query objects.If you provide both
Tag.NandResourceId.Nin your request, the response will exclusively include Auto Scaling resources that satisfy the criteria set by these parameters, ensuring targeted and precise information retrieval.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | ListTagResources | The operation that you want to perform. Set the value to ListTagResources. |
RegionId | String | Yes | cn-hangzhou | The region ID of the resource. You can call the DescribeRegions operation to query the most recent region list. |
ResourceType | String | Yes | scalinggroup | The resource type. Set the value to scalinggroup. |
NextToken | String | No | caeba0bbb2be03f84eb48b699f0a4883 | The pagination token that is used in the next request to retrieve a new page of results. |
ResourceId.N | String | No | asg-bp17xb4x1vr29lgt**** | The ID of resource N. Valid values of N: 1 to 50. |
Tag.N.Key | String | No | TestKey | The key of tag N. The key is utilized to precisely locate and identify Auto Scaling resources. The key must be 1 to 128 characters in length. Valid values of N: 1 to 20.
|
Tag.N.Value | String | No | TestValue | The value of tag N. The value is utilized to precisely locate and identify Auto Scaling resources. The tag value can be an empty string. The value can be up to 128 characters in length. Valid values of N: 1 to 20. |
Response parameters
Parameter | Type | Example | Description |
NextToken | String | caeba0bbb2be03f84eb48b699f0a4883 | A pagination token. It can be used in the next request to retrieve a new page of results. |
RequestId | String | DE65F6B7-7566-4802-9007-96F2494A**** | The request ID. |
TagResources | Array of TagResource | An array that encompasses both the resource details and its tags, comprising elements such as the resource ID, the resource type, the tag key, and the tag value. | |
TagResource | |||
TagValue | String | TestValue | The tag value of the resource. |
ResourceType | String | ALIYUN::ESS::SCALINGGROUP | The resource type. |
ResourceId | String | asg-bp17xb4x1vr29lgt**** | The resource ID. |
TagKey | String | TestKey | The tag key of the resource. |
Propagate | Boolean | false | Indicates whether the tags can be propagated to instances. Valid values:
|
Examples
Sample requests
http(s)://ess.aliyuncs.com/?Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=scalinggroup
&NextToken=caeba0bbb2be03f84eb48b699f0a4883
&ResourceId=["asg-bp17xb4x1vr29lgt****"]
&Tag=[{"Key":"TestKey","Value":"TestValue"}]
&<Common request parameters>Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListTagResourcesResponse>
<NextToken>caeba0bbb2be03f84eb48b699f0a4883</NextToken>
<RequestId>DE65F6B7-7566-4802-9007-96F2494A****</RequestId>
<TagResources>
<TagValue>TestValue</TagValue>
<ResourceType>ALIYUN::ESS::SCALINGGROUP</ResourceType>
<ResourceId>asg-bp17xb4x1vr29lgt****</ResourceId>
<TagKey>TestKey</TagKey>
<Propagate>false</Propagate>
</TagResources>
</ListTagResourcesResponse>JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"NextToken" : "caeba0bbb2be03f84eb48b699f0a4883",
"RequestId" : "DE65F6B7-7566-4802-9007-96F2494A****",
"TagResources" : [ {
"TagValue" : "TestValue",
"ResourceType" : "ALIYUN::ESS::SCALINGGROUP",
"ResourceId" : "asg-bp17xb4x1vr29lgt****",
"TagKey" : "TestKey",
"Propagate" : false
} ]
}Error codes
For a list of error codes, see Service error codes.