1. 接口描述
接口请求域名: as.tencentcloudapi.com 。
本接口(DescribeAutoScalingGroups)用于查询伸缩组信息。
- 可以根据伸缩组ID、伸缩组名称或者启动配置ID等信息来查询伸缩组的详细信息。过滤信息详细请见过滤器
Filter
。 - 如果参数为空,返回当前用户一定数量(
Limit
所指定的数量,默认为20)的伸缩组。
默认接口请求频率限制:60次/秒。
推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。
2. 输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeAutoScalingGroups。 |
Version | 是 | String | 公共参数,本接口取值:2018-04-19。 |
Region | 是 | String | 公共参数,详见产品支持的 地域列表。 |
AutoScalingGroupIds.N | 否 | Array of String | 按照一个或者多个伸缩组ID查询。伸缩组ID形如:asg-nkdwoui0 。每次请求的上限为100。参数不支持同时指定AutoScalingGroupIds 和Filters 。示例值:["asg-nkdwoui0"] |
Filters.N | 否 | Array of Filter | 过滤条件。 每次请求的 Filters 的上限为10,Filter.Values 的上限为5。参数不支持同时指定AutoScalingGroupIds 和Filters 。示例值:[{"Name": "auto-scaling-group-name", "Values": ["production-as"]}] |
Limit | 否 | Integer | 返回数量,默认为20,最大值为100。关于Limit 的更进一步介绍请参考 API 简介中的相关小节。示例值:10 |
Offset | 否 | Integer | 偏移量,默认为0。关于Offset 的更进一步介绍请参考 API 简介中的相关小节。示例值:0 |
3. 输出参数
参数名称 | 类型 | 描述 |
---|---|---|
AutoScalingGroupSet | Array of AutoScalingGroup | 伸缩组详细信息列表。 示例值:[{"InActivityStatus": "NOT_IN_ACTIVITY", "LoadBalancerIdSet": [], "RetryPolicy": "IMMEDIATE_RETRY", "InServiceInstanceCount": 0, "CreatedTime": "2022-03-19T04:39:52Z", "VpcId": "vpc-nqayns0m", "InstanceAllocationPolicy": "LAUNCH_CONFIGURATION", "Tags": [], "LaunchConfigurationId": "asc-rgrdh183","MaxSize": 500, "MultiZoneSubnetPolicy": "EQUALITY", "SubnetIdSet": ["subnet-d9gneeoz",], "HealthCheckType": "CLB", "LoadBalancerHealthCheckGracePeriod": 0, "ForwardLoadBalancerSet": [], "ProjectId": 0, "AutoScalingGroupName": "tke-np-w", "MinSize": 0, "ServiceSettings": {"ReplaceMonitorUnhealthy": false, "ReplaceLoadBalancerUnhealthy": false, "ReplaceMode": "RECREATE", "ScalingMode": "CLASSIC_SCALING"}, "LaunchConfigurationName": "tke-np-ww", "CapacityRebalance": false, "TerminationPolicySet": ["OLDEST_INSTANCE"], "AutoScalingGroupStatus": "NORMAL", "InstanceCount": 0, "DesiredCapacity": 0, "AutoScalingGroupId": "asg-07tasrpr", "Ipv6AddressCount": 0, "DefaultCooldown": 300, "EnabledStatus": "ENABLED", "ZoneSet": []}] |
TotalCount | Integer | 符合条件的伸缩组数量。 示例值:1 |
RequestId | String | 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 |
4. 示例
示例1 查询伸缩组
指定伸缩组ID查询伸缩组
输入示例
POST / HTTP/1.1
Host: as.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeAutoScalingGroups
<公共请求参数>
{
"AutoScalingGroupIds": [
"asg-pts6qcgp"
]
}
输出示例
{
"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",
"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"
}
}
示例2 查询绑定了标签的伸缩组
查询绑定了标签键值对(city:shenzhen)的伸缩组。
输入示例
POST / HTTP/1.1
Host: as.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeAutoScalingGroups
<公共请求参数>
{
"Limit": 1,
"Filters": [
{
"Values": [
"shenzhen"
],
"Name": "tag:city"
}
],
"Offset": 0
}
输出示例
{
"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",
"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",
"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. 开发者资源
腾讯云 API 平台
腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。
API Inspector
用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。
SDK
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
- Tencent Cloud SDK 3.0 for Python: GitHub Gitee
- Tencent Cloud SDK 3.0 for Java: GitHub Gitee
- Tencent Cloud SDK 3.0 for PHP: GitHub Gitee
- Tencent Cloud SDK 3.0 for Go: GitHub Gitee
- Tencent Cloud SDK 3.0 for Node.js: GitHub Gitee
- Tencent Cloud SDK 3.0 for .NET: GitHub Gitee
- Tencent Cloud SDK 3.0 for C++: GitHub Gitee
- Tencent Cloud SDK 3.0 for Ruby: GitHub Gitee
命令行工具
6. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
错误码 | 描述 |
---|---|
InvalidParameter.ActionNotFound | 无效的Action请求。 |
InvalidParameter.Conflict | 参数冲突,指定的多个参数冲突,不能同时存在。 |
InvalidParameterConflict | 指定的两个参数冲突,不能同时存在。 |
InvalidParameterValue.Filter | 无效的过滤器。 |
InvalidParameterValue.InvalidAutoScalingGroupId | 伸缩组ID无效。 |
InvalidParameterValue.InvalidFilter | 过滤条件无效。 |
InvalidParameterValue.InvalidLaunchConfigurationId | 启动配置ID无效。 |
InvalidParameterValue.LimitExceeded | 取值超出限制。 |
InvalidParameterValue.TooLong | 取值过多。 |
InvalidPermission | 账户不支持该操作。 |
LimitExceeded.FilterValuesTooLong | 特定过滤器的值过多。 |
UnsupportedOperation | 操作不支持。 |