Queries the tags that are added to one or more Auto Scaling resources.
Description
- Specify
ResourceId.N
orTag.N
that consists ofTag.N.Key
andTag.N.Value
in the request to specify the objects that you want to query. - If you specify
Tag.N
andResourceId.N
at the same time, the Auto Scaling resources that match both the parameters are returned.
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 type of the resource. Only scaling groups are supported. Set the value to scalinggroup. |
NextToken | String | No | caeba0bbb2be03f84eb48b699f0a4883 |
The token that is used for the next query. |
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 used to perform an exact match of 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 used to perform an exact match of Auto Scaling resources. The tag value can be an empty string, and it can be up to 128 characters in length. Valid values of N: 1 to 20. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | caeba0bbb2be03f84eb48b699f0a4883 |
The token that is returned for the next query. |
RequestId | String | DE65F6B7-7566-4802-9007-96F2494A**** |
The ID of the request. |
TagResources | Array of TagResource |
The details of resources and tags, including resource IDs, resource types, and tag key-value pairs. |
|
TagResource | |||
TagValue | String | TestValue |
The value of the tag. |
ResourceType | String | ALIYUN::ESS::SCALINGGROUP |
The type of the resource. |
ResourceId | String | asg-bp17xb4x1vr29lgt**** |
The ID of the resource. |
TagKey | String | TestKey |
The key of the tag. |
Propagate | Boolean | false |
Indicates whether the tag can be propagated.
|
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, visit the API Error Center.