DescribeScalingActivities - 查詢伸縮活動
通過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******"
]
}
]
}
]
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。