tencent cloud

弹性伸缩

产品简介
产品概述
产品优势
应用场景
使用限制
访问管理
购买指南
快速入门
五分钟创建伸缩方案
步骤1:创建启动配置
步骤2:创建伸缩组
步骤3:创建伸缩策略
教程
创建 Web 服务
创建高性能计算集群
创建请求类服务器
配置高可用业务
启动配置
启动配置概述
创建启动配置
查看启动配置列表
更改启动配置
检测异常
伸缩组
伸缩组概述
创建伸缩组
查看伸缩组列表
修改伸缩组
修改伸缩组绑定的实例
将负载均衡与伸缩组结合
删除伸缩组
创建通知
创建伸缩活动通知
指定通知接收人
扩缩容
生命周期挂钩
管理定时任务
管理告警触发策略
实例健康检查
手动扩容
缩容处理
查看伸缩活动
暂停及恢复扩缩容
指定实例免于缩容
伸缩活动取消
伸缩活动失败
冷却时间说明
监控
监控告警指标
运行状态检查
定时任务
定时任务执行时间说明
故障处理
伸缩组失效
伸缩活动失败
实践教程
为伸缩组设置固定出口 IP
部署弹性 Web 应用服务
设置服务开机启动
客户案例
高性能计算:碳云数据挖掘
API 文档
History
Introduction
API Category
Making API Requests
Scaling Group APIs
Scaling Group Instances APIs
Launch Configuration APIs
Scheduled Action APIs
Alarm Trigger Policy APIs
Notification APIs
Lifecycle Hook APIs
Instance Refresh APIs
Other APIs
Data Types
Error Codes
常见问题
联系我们
词汇表

DescribeAutoScalingGroups

PDF
聚焦模式
字号
最后更新时间: 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.

    帮助和支持

    本页内容是否解决了您的问题?

    填写满意度调查问卷,共创更好文档体验。

    文档反馈