通过API DescribeScalingActivities查看伸缩活动的详情,了解通过定时任务、报警任务或手动执行伸缩规则等方式触发伸缩活动的结果。例如,您可以在伸缩活动详情页查看到伸缩活动的状态、活动起因、变化后总实例数等信息。
接口说明
-
查询时可以指定伸缩组 ID 来查询该伸缩组下的所有伸缩活动。
-
查询时可以通过伸缩活动的状态来过滤查询结果。
-
可以查询 30 日内的伸缩活动。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ess:DescribeScalingActivities |
get |
*ScalingGroup
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
伸缩活动所属伸缩组的地域 ID。 |
cn-hangzhou |
| PageNumber |
integer |
否 |
伸缩活动列表的页码,起始值:1。 默认值:1。 |
1 |
| PageSize |
integer |
否 |
分页查询时设置的每页行数,最大值:50。 默认值:10。 |
10 |
| ScalingGroupId |
string |
否 |
伸缩组的 ID。 说明
调用该 API 时, |
asg-bp18p2yfxow2dloq**** |
| StatusCode |
string |
否 |
伸缩活动的状态。取值范围:
|
Successful |
| ScalingActivityIds |
array |
否 |
待查询伸缩活动的 ID。 说明
调用该 API 时, |
|
|
string |
否 |
待查询伸缩活动的 ID。 说明
调用该 API 时, |
asa-bp161xudmuxdzofe**** |
|
| InstanceRefreshTaskId |
string |
否 |
实例刷新任务 ID,可以设置此参数查询实例刷新任务相关的伸缩活动列表。 |
ir-a12ds234fasd***** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
CC107349-57B7-4405-B1BF-9BF5AF7F**** |
| PageNumber |
integer |
当前页码。 |
1 |
| PageSize |
integer |
每页行数。 |
10 |
| TotalCount |
integer |
伸缩活动总数。 |
1 |
| ScalingActivities |
array<object> |
伸缩活动信息组成的集合。 |
|
|
array<object> |
伸缩活动信息组成的集合。 |
||
| Progress |
integer |
伸缩活动的运行进度。 |
100 |
| ScalingInstanceNumber |
integer |
|
1 |
| AttachedCapacity |
string |
执行完伸缩活动后,伸缩组中通过手动添加的实例总数。 |
0 |
| TotalCapacity |
string |
执行完伸缩活动后,伸缩组中实例的总数。 |
2 |
| ScalingGroupId |
string |
伸缩组的 ID。 |
asg-bp18p2yfxow2dloq**** |
| AutoCreatedCapacity |
string |
执行完伸缩活动后,伸缩组中由伸缩组负责自动创建的实例的总数。 |
2 |
| EndTime |
string |
伸缩活动的结束时间。 |
2020-09-10T09:54Z |
| StartTime |
string |
伸缩活动的开始时间。 |
2020-09-10T09:54Z |
| Description |
string |
伸缩活动的描述信息。 |
Add \"1\" ECS instance |
| StatusCode |
string |
伸缩活动的状态,可能值:
|
Successful |
| Cause |
string |
触发伸缩活动的原因。 |
A user requests to execute scaling rule \"asr-bp12tcnol686y1ik****\", changing the Total Capacity from \"1\" to \"2\". |
| ScalingActivityId |
string |
伸缩活动的 ID。 |
asa-bp161xudmuxdzofe**** |
| StatusMessage |
string |
伸缩活动的状态信息。 |
\"1\" ECS instances are added |
| CreatedCapacity |
integer |
当前伸缩活动新建的实例数量。 |
1 |
| DestroyedCapacity |
integer |
当前伸缩活动释放的实例数量。 |
1 |
| StartedCapacity |
integer |
当前伸缩活动从停机不收费状态启动的实例数量。 |
1 |
| StoppedCapacity |
integer |
当前伸缩活动进入停机不收费状态的实例数量。 |
1 |
| CreatedInstances |
array |
当前伸缩活动新建实例列表。 |
|
|
string |
当前伸缩活动新建实例列表。 |
["i-abc1","i-abc2"] |
|
| DestroyedInstances |
array |
当前伸缩活动释放实例列表。 |
|
|
string |
当前伸缩活动释放实例列表。 |
[ "i-abc1", "i-abc2" ] |
|
| StartedInstances |
array |
当前伸缩活动启动的停机不收费实例列表。 |
|
|
string |
当前伸缩活动启动的停机不收费实例列表。 |
[ "i-abc1", "i-abc2" ] |
|
| StoppedInstances |
array |
当前伸缩活动进入停机不收费状态实例列表。 |
|
|
string |
当前伸缩活动进入停机不收费状态实例列表。 |
[ "i-abc1", "i-abc2" ] |
|
| ErrorCode |
string |
伸缩活动失败时的错误码。 |
OperationDenied.NoStock |
| ErrorMessage |
string |
伸缩活动失败时的错误信息。 |
The specified ECS resource is out of stock in this region. Please try again later. |
| Detail |
string |
伸缩活动详细信息。 |
"new ECS instances "i-j6c8ilerw, i-j6c8iler4mx" are created." |
| TriggerSourceType |
string |
伸缩活动触发源类型。可能值:
|
Api |
| TriggerSourceId |
string |
伸缩活动触发源 ID。可能值:
|
2346366580***** |
| LifecycleHookContext |
object |
生命周期挂钩上下文信息。 |
|
| DisableLifecycleHook |
boolean |
伸缩活动是否禁用所有生命周期挂钩。可能值:
|
false |
| IgnoredLifecycleHookIds |
array |
伸缩活动禁用的生命周期挂钩 ID 列表。 |
|
|
string |
伸缩活动禁用的生命周期挂钩 ID 列表。 |
ash-bp14zolna43z266bq*** |
|
| ActivityMetadata |
string |
伸缩活动的元数据。 |
{\"goatscaler.io/managed\":\"true\"} |
| InstanceRefreshTaskId |
string |
实例刷新任务 ID。 |
ir-asdf12adsxg***** |
| ErrorMessages |
array<object> |
伸缩活动失败或部分成功时的错误信息。 |
|
|
object |
|||
| Description |
string |
伸缩活动的异常描述。 |
Fail to create instances into scaling group. |
| Code |
string |
伸缩活动失败或部分成功时的错误码。 |
OperationDenied.NoStock |
| Message |
string |
伸缩活动失败或部分成功时的错误信息。 |
The resource is out of stock in the specified zone. Please try other types, or choose other regions and zones. |
| FailedInstanceIds |
array |
失败的实例 ID 列表。 |
|
|
string |
实例 ID。 |
i-8vbedazhjj6a6****** |
示例
正常返回示例
JSON格式
{
"RequestId": "CC107349-57B7-4405-B1BF-9BF5AF7F****",
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 1,
"ScalingActivities": [
{
"Progress": 100,
"ScalingInstanceNumber": 1,
"AttachedCapacity": "0",
"TotalCapacity": "2",
"ScalingGroupId": "asg-bp18p2yfxow2dloq****",
"AutoCreatedCapacity": "2",
"EndTime": "2020-09-10T09:54Z",
"StartTime": "2020-09-10T09:54Z",
"Description": "Add \\\"1\\\" ECS instance",
"StatusCode": "Successful",
"Cause": "A user requests to execute scaling rule \\\"asr-bp12tcnol686y1ik****\\\", changing the Total Capacity from \\\"1\\\" to \\\"2\\\".",
"ScalingActivityId": "asa-bp161xudmuxdzofe****",
"StatusMessage": "\\\"1\\\" ECS instances are added",
"CreatedCapacity": 1,
"DestroyedCapacity": 1,
"StartedCapacity": 1,
"StoppedCapacity": 1,
"CreatedInstances": [
"[\"i-abc1\",\"i-abc2\"]"
],
"DestroyedInstances": [
"[\n \"i-abc1\",\n \"i-abc2\"\n]"
],
"StartedInstances": [
"[\n \"i-abc1\",\n \"i-abc2\"\n]"
],
"StoppedInstances": [
"[\n \"i-abc1\",\n \"i-abc2\"\n]"
],
"ErrorCode": "OperationDenied.NoStock",
"ErrorMessage": "The specified ECS resource is out of stock in this region. Please try again later.",
"Detail": "\"new ECS instances \"i-j6c8ilerw, i-j6c8iler4mx\" are created.\"",
"TriggerSourceType": "Api",
"TriggerSourceId": "2346366580*****",
"LifecycleHookContext": {
"DisableLifecycleHook": false,
"IgnoredLifecycleHookIds": [
"ash-bp14zolna43z266bq***\n"
]
},
"ActivityMetadata": "{\\\"goatscaler.io/managed\\\":\\\"true\\\"}",
"InstanceRefreshTaskId": "ir-asdf12adsxg*****",
"ErrorMessages": [
{
"Description": "Fail to create instances into scaling group.",
"Code": "OperationDenied.NoStock",
"Message": "The resource is out of stock in the specified zone. Please try other types, or choose other regions and zones.",
"FailedInstanceIds": [
"i-8vbedazhjj6a6******"
]
}
]
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。