tencent cloud

DescribeAutoScalingGroups
Last updated: 2025-10-30 21:28:15
DescribeAutoScalingGroups
Last updated: 2025-10-30 21:28:15

1. API Description

Domain name for API request: as.intl.tencentcloudapi.com.

This API (DescribeAutoScalingGroups) is used to query the information of auto scaling groups.

  • You can query the details of auto scaling groups based on information such as auto scaling group ID, auto scaling group name, or launch configuration ID. For more information on filters, see Filter.
  • If the parameter is empty, a certain number (specified by Limit and 20 by default) of auto scaling groups of the current user will be returned.

A maximum of 60 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeAutoScalingGroups.
Version Yes String Common Params. The value used for this API: 2018-04-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
AutoScalingGroupIds.N No Array of String Queries by one or more auto scaling group IDs in the format of asg-nkdwoui0. The maximum quantity per request is 100. This parameter does not support specifying both AutoScalingGroupIds and Filters at the same time.
Filters.N No Array of Filter Filter criteria

  • auto-scaling-group-id - String - required: no - (filter) filter by auto scaling group id.
  • .
    Specifies the scaling group ID obtained by logging in to the console or calling the api DescribeAutoScalingGroups and retrieving the AutoScalingGroupId from the return information.
  • auto-scaling-group-name - String - required: no - (filter) filter by auto scaling group name.
  • .
  • vague-auto-scaling-group-name - String - required: no - (filter) filter by scaling group name fuzzy search.
  • .
  • launch-configuration-id - String - required: no - (filter condition) filter by launch configuration id. you can obtain the launch configuration id by logging in to the console (https://console.tencentcloud.com/autoscaling/config) or calling the api DescribeLaunchConfigurations (https://www.tencentcloud.com/document/api/377/20445?from_cn_redirect=1) and retrieving the LaunchConfigurationId from the returned information.
  • .
  • tag-key - String - optional - filter by the tag key. you can call the API GetTags to obtain the tag key from the returned information.
  • .
  • tag-value - String - required: no - (filter condition) filter by tag value. you can obtain the tag value by calling the API GetTags and retrieving the TagValue from the returned information.
  • .
  • tag:tag-key - String - required: no - (filter condition) filter by tag key-value pair. replace tag-key with a specific tag key. see example 2 for reference. call the API GetTags to obtain the TagKey from the returned information.
  • .
    The maximum number of Filters per request is 10, and that of Filter.Values is 5. the AutoScalingGroupIds and Filters parameters cannot be specified simultaneously.
    Limit No Integer Number of returned results. Default value: 20. Maximum value: 100. For more information on Limit, see the relevant section in the API overview.
    Offset No Integer Offset. Default value: 0. For more information on Offset, see the relevant section in the API overview.

    3. Output Parameters

    Parameter Name Type Description
    AutoScalingGroupSet Array of AutoScalingGroup List of auto scaling group details.
    TotalCount Integer Number of eligible auto scaling groups.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Querying Scaling Groups

    This example shows you how to query scaling groups by ID.

    Input Example

    POST / HTTP/1.1
    Host: as.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeAutoScalingGroups
    <Common request parameters>
    
    {
        "AutoScalingGroupIds": [
            "asg-pts6qcgp"
        ]
    }

    Output Example

    {
        "Response": {
            "AutoScalingGroupSet": [
                {
                    "InActivityStatus": "NOT_IN_ACTIVITY",
                    "LoadBalancerIdSet": [],
                    "InstanceNameIndexSettings": {
                        "BeginIndex": 0,
                        "Enabled": true
                    },
                    "RetryPolicy": "IMMEDIATE_RETRY",
                    "InServiceInstanceCount": 0,
                    "CreatedTime": "2022-04-21T03:21:14Z",
                    "SpotMixedAllocationPolicy": {
                        "CompensateWithBaseInstance": null,
                        "SpotAllocationStrategy": null,
                        "OnDemandPercentageAboveBaseCapacity": null,
                        "BaseCapacity": null
                    },
                    "VpcId": "vpc-lceuvai4",
                    "InstanceAllocationPolicy": "LAUNCH_CONFIGURATION",
                    "Tags": [],
                    "LaunchConfigurationId": "asc-mo1woym9",
                    "MaxSize": 1,
                    "MultiZoneSubnetPolicy": "PRIORITY",
                    "SubnetIdSet": [
                        "subnet-6qqolfi7"
                    ],
                    "HealthCheckType": "CLB",
                    "LoadBalancerHealthCheckGracePeriod": 0,
                    "ForwardLoadBalancerSet": [
                        {
                            "TargetAttributes": [
                                {
                                    "Port": 8080,
                                    "Weight": 10
                                }
                            ],
                            "Region": "ap-shanghai",
                            "LocationId": "loc-5dovrfov",
                            "ListenerId": "lbl-i4p05pmv",
                            "LoadBalancerId": "lb-pbx8nq2p"
                        }
                    ],
                    "ProjectId": 0,
                    "AutoScalingGroupName": "product-asg-001",
                    "MinSize": 0,
                    "ServiceSettings": {
                        "ReplaceMonitorUnhealthy": false,
                        "ReplaceLoadBalancerUnhealthy": false,
                        "ScalingMode": "CLASSIC_SCALING",
                        "DesiredCapacitySyncWithMaxMinSize": false,
                        "ReplaceMode": "RECREATE"
                    },
                    "LaunchConfigurationName": "product-asc-001",
                    "CapacityRebalance": false,
                    "TerminationPolicySet": [
                        "OLDEST_INSTANCE"
                    ],
                    "AutoScalingGroupStatus": "NORMAL",
                    "InstanceCount": 0,
                    "DesiredCapacity": 0,
                    "AutoScalingGroupId": "asg-pts6qcgp",
                    "Ipv6AddressCount": 0,
                    "DefaultCooldown": 300,
                    "EnabledStatus": "ENABLED",
                    "ZoneSet": []
                }
            ],
            "TotalCount": 1,
            "RequestId": "53a76c96-a88c-4972-8488-66d6c15a080f"
        }
    }

    Example2 Querying Scaling Groups Bound with Tags

    This example shows you how to query scaling groups bound with the tag key-value pair (city:shenzhen).

    Input Example

    POST / HTTP/1.1
    Host: as.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeAutoScalingGroups
    <Common request parameters>
    
    {
        "Limit": 1,
        "Filters": [
            {
                "Values": [
                    "shenzhen"
                ],
                "Name": "tag:city"
            }
        ],
        "Offset": 0
    }

    Output Example

    {
        "Response": {
            "AutoScalingGroupSet": [
                {
                    "InActivityStatus": "NOT_IN_ACTIVITY",
                    "LoadBalancerIdSet": [],
                    "InstanceNameIndexSettings": {
                        "BeginIndex": 0,
                        "Enabled": true
                    },
                    "RetryPolicy": "IMMEDIATE_RETRY",
                    "InServiceInstanceCount": 0,
                    "CreatedTime": "2019-10-29T02:21:26Z",
                    "SpotMixedAllocationPolicy": {
                        "CompensateWithBaseInstance": null,
                        "SpotAllocationStrategy": null,
                        "OnDemandPercentageAboveBaseCapacity": null,
                        "BaseCapacity": null
                    },
                    "VpcId": "vpc-qmjyqjnk",
                    "InstanceAllocationPolicy": "LAUNCH_CONFIGURATION",
                    "Tags": [
                        {
                            "Key": "city",
                            "ResourceType": "auto-scaling-group",
                            "Value": "shenzhen"
                        }
                    ],
                    "LaunchConfigurationId": "asc-3d9e2zfx",
                    "MaxSize": 10,
                    "MultiZoneSubnetPolicy": "PRIORITY",
                    "SubnetIdSet": [
                        "subnet-3cpb9yfp",
                        "subnet-c98udmmr",
                        "subnet-1xsr551x",
                        "subnet-o3ibshdr",
                        "subnet-6c7q2jhz"
                    ],
                    "HealthCheckType": "CVM",
                    "LoadBalancerHealthCheckGracePeriod": 0,
                    "ForwardLoadBalancerSet": [
                        {
                            "TargetAttributes": [
                                {
                                    "Port": 8080,
                                    "Weight": 10
                                }
                            ],
                            "Region": "ap-shanghai",
                            "LocationId": "loc-y6t5rew2",
                            "ListenerId": "lbl-aiwdu9bd",
                            "LoadBalancerId": "lb-k264wzwj"
                        },
                        {
                            "TargetAttributes": [
                                {
                                    "Port": 80,
                                    "Weight": 10
                                }
                            ],
                            "Region": "ap-shanghai",
                            "LocationId": "loc-qmxmx085",
                            "ListenerId": "lbl-ldjbrn65",
                            "LoadBalancerId": "lb-k264wzwj"
                        }
                    ],
                    "ProjectId": 0,
                    "AutoScalingGroupName": "sz-asg",
                    "MinSize": 0,
                    "ServiceSettings": {
                        "ReplaceMonitorUnhealthy": false,
                        "ReplaceLoadBalancerUnhealthy": false,
                        "ReplaceMode": "RECREATE",
                        "DesiredCapacitySyncWithMaxMinSize": false,
                        "ScalingMode": "CLASSIC_SCALING"
                    },
                    "LaunchConfigurationName": "sz-asc",
                    "CapacityRebalance": false,
                    "TerminationPolicySet": [
                        "OLDEST_INSTANCE"
                    ],
                    "AutoScalingGroupStatus": "NORMAL",
                    "InstanceCount": 0,
                    "DesiredCapacity": 0,
                    "AutoScalingGroupId": "asg-h71x7a3f",
                    "Ipv6AddressCount": 0,
                    "DefaultCooldown": 300,
                    "EnabledStatus": "ENABLED",
                    "ZoneSet": []
                }
            ],
            "TotalCount": 1,
            "RequestId": "53a76c96-a88c-4972-8488-66d6c15a080f"
        }
    }

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InvalidParameter.ActionNotFound Invalid Action request.
    InvalidParameter.Conflict Multiple parameters specified conflict and cannot co-exist.
    InvalidParameterConflict The two parameters specified conflict and cannot co-exist.
    InvalidParameterValue.Filter Invalid filter.
    InvalidParameterValue.InvalidAutoScalingGroupId Invalid scaling group ID.
    InvalidParameterValue.InvalidFilter Invalid filter condition.
    InvalidParameterValue.InvalidLaunchConfigurationId Invalid launch configuration ID.
    InvalidParameterValue.LimitExceeded The value exceeds the limit.
    InvalidParameterValue.TooLong Too many values.
    InvalidPermission The account does not support this operation.
    LimitExceeded.FilterValuesTooLong Too many values for the specified filter
    UnsupportedOperation Unsupported operation.
    Was this page helpful?
    You can also Contact Sales or Submit a Ticket for help.
    Yes
    No

    Feedback