有奖捉虫:云通信与企业服务文档专题,速来> HOT
说明:

当前页面接口为旧版 API,未来可能停止维护。容器服务 API 3.0 版本接口定义更加规范,访问时延下降显著,建议使用 容器服务 API 3.0

接口描述

本接口 (DescribeClusterAsg) 用于查询集群伸缩组信息。

接口请求域名:

ccs.api.qcloud.com

输入参数

以下请求参数列表仅列出了接口请求参数,其它参数见 公共请求参数 页面。

参数名称 描述 必选 类型
clusterId 集群 ID,请填写 查询集群列表 接口中返回的 clusterId 字段 String
autoScalingGroupId 伸缩组 ID String
status 伸缩组状态, 详情参见状态列表 String
offset 偏移量,默认 0 Int
limit 最大输出条数,默认 20 Int

状态列表

状态 描述
disabled 已停用
disabling 停用中
enabled 已启用
enabling 启用中
updating 更新中

输出参数

参数名称 描述 类型
code 公共错误码。0 表示成功,其他值表示失败 Int
codeDesc 业务侧错误码。成功时返回 Success,错误时返回具体业务错误原因 String
message 模块错误信息描述,与接口相关 String
data 伸缩组信息,详细信息如下 Array

其中 data 的数据结构如下:

参数名称 描述 类型
totalCount 结果总数 Int
asgInfo 伸缩组列表,详细信息如下 Array

asgInfo 中每个伸缩组的数据结构如下:

字段 描述 类型
autoScalingGroupId 伸缩组 ID String
autoScalingGroupName 伸缩组名称 String
clusterId 集群 ID String
status 伸缩组状态 String
scaleDownEnabled 是否启用缩容 Bool
minSize 伸缩组最小值 Int
maxSize 伸缩组最大值 Int
instanceNum 伸缩组内的 cvm 数量 Int
desiredCapacity 伸缩组内期望的 cvm 数量 Int
label 伸缩组内 cvm 的 label Array
launchConfigurationId 启动配置 ID String
launchConfigurationName 启动配置名称 String

示例

输入

  https://domain/v2/index.php?Action=DescribeClusterAsg
  &clusterId=cls-xxxxxxxx
  &autoScalingGroupId=asg-xxxxxxxx
  &status=enabled
  &offset=0
  &limit=20
  &其它公共参数

输出

{
    "code": 0,
    "message": "",
    "codeDesc": "Success",
    "data": {
        "totalCount": 1,
        "asgInfo": [
            {
                "autoScalingGroupId": "asg-xxxxxxxx",
                "autoScalingGroupName": "cls-xxxxxxxx-g1867619587",
                "clusterId": "cls-xxxxxxxx",
                "status": "enabled",
                "scaleDownEnabled": false,
                "label": [],
                "minSize": 0,
                "maxSize": 5,
                "instanceNum": 0,
                "desiredCapacity": 1,
                "launchConfigurationId": "asc-xxxxxxxx",
                "launchConfigurationName": "cls-xxxxxxxx-c123109984"
            }
        ]
    }
}