All Products
Search
Document Center

Auto Scaling:ListTagResources

Last Updated:Jun 24, 2024

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.

Operation description

  • Specify at least one of the following request parameters: ResourceIds and Tags. Tags.Key and Tags.Value are used to specify the query objects.
  • If you provide both ResourceIds and Tags in 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the resource. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ResourceTypestringYes

The resource type. Set the value to scalinggroup.

scalinggroup
NextTokenstringNo

The token that determines the start point of the next query.

caeba0bbb2be03f84eb48b699f0a4883
ResourceIdsarrayNo

The IDs of the Auto Scaling resources. You can specify 1 to 50 resource IDs.

stringNo

The IDs of the Auto Scaling resources. You can specify 1 to 50 resource IDs.

asg-bp17xb4x1vr29lgt****
Tagsobject []No

Details of the tags.

KeystringNo

The key of the tag. The key is used to perform an exact match of Auto Scaling resources. The key must be 1 to 128 characters in length.

Tags is used to perform an exact match of Auto Scaling resources to which the specified tags are added. Specify a tag in the key-value pair format.

  • If you specify only Tags.Key, all resources whose tags contain the specified tag key are returned.
  • If you specify only Tags.Value, the MissingParameter.TagKey error is reported.
  • If you specify multiple key-value pairs at the same time, only Auto Scaling resources that match all the tag keys and tag values are returned.
TestKey
ValuestringNo

The value of the tag. The value is used to perform an exact match of Auto Scaling resources. The value can be up to 128 characters in length.

TestValue

Response parameters

ParameterTypeDescriptionExample
object

The response that is returned.

NextTokenstring

The token that determines the start point of the next query.

caeba0bbb2be03f84eb48b699f0a4883
RequestIdstring

The ID of the request.

DE65F6B7-7566-4802-9007-96F2494A****
TagResourcesobject []

An array that encompasses both the resource details and its tags, comprising elements like the resource ID, the resource type, the tag key, and the tag value.

TagValuestring

The tag value of the resource.

TestValue
ResourceTypestring

The resource type.

ALIYUN::ESS::SCALINGGROUP
ResourceIdstring

The resource ID.

asg-bp17xb4x1vr29lgt****
TagKeystring

The tag key of the resource.

TestKey
Propagateboolean

Indicates whether the tags of the scaling group can be propagated to instances. Valid values:

  • true: The tags of the scaling group can be propagated to only instances that are newly created.
  • false: The tags of the scaling group cannot be propagated to instances.
false

Examples

Sample success responses

JSONformat

{
  "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 Service error codes.

Change history

Change timeSummary of changesOperation
No change history