Queries the details of scaling activities by calling the DescribeScalingActivities operation. You can use this operation to view the results of scaling activities triggered by scheduled tasks, event-triggered tasks, or manual execution of scaling rules. For example, you can view the status, cause, and total number of instances after the change for a scaling activity.
Operation description
Operation description
-
You can specify a scaling group ID to query all scaling activities in the scaling group.
-
You can filter query results by the status of scaling activities.
-
You can query scaling activities within the last 30 days.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:DescribeScalingActivities |
get |
*ScalingGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the scaling group to which the scaling activities belong. |
cn-hangzhou |
| PageNumber |
integer |
No |
The page number of the scaling activity list. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page for a paged query. Maximum value: 50. Default value: 10. |
10 |
| ScalingGroupId |
string |
No |
The ID of the scaling group. Note
When you call this operation, you must specify either ScalingGroupId or ScalingActivityId.N. An error is returned if neither parameter is specified. |
asg-bp18p2yfxow2dloq**** |
| StatusCode |
string |
No |
The status of the scaling activity. Valid values:
|
Successful |
| ScalingActivityId |
array |
No |
The IDs of the scaling activities that you want to query. Note
When you call this operation, you must specify either ScalingGroupId or ScalingActivityId.N. An error is returned if neither parameter is specified. |
|
|
string |
No |
The ID of the scaling activity that you want to query. Note
When you call this operation, you must specify either ScalingGroupId or ScalingActivityId.N. An error is returned if neither parameter is specified. |
asa-bp161xudmuxdzofe**** |
|
| InstanceRefreshTaskId |
string |
No |
The ID of the instance refresh task. You can specify this parameter to query the list of scaling activities associated with the instance refresh task. |
ir-a12ds234fasd***** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
CC107349-57B7-4405-B1BF-9BF5AF7F**** |
| PageNumber |
integer |
The current page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| TotalCount |
integer |
The total number of scaling activities. |
1 |
| ScalingActivities |
object |
||
| ScalingActivity |
array<object> |
The collection of scaling activity information. |
|
|
array<object> |
The collection of scaling activity information. |
||
| Progress |
integer |
The execution progress of the scaling activity. |
100 |
| ScalingInstanceNumber |
integer |
|
1 |
| AttachedCapacity |
string |
The total number of instances that were manually added to the scaling group after the scaling activity was complete. |
0 |
| TotalCapacity |
string |
The total number of instances in the scaling group after the scaling activity was complete. |
2 |
| ScalingGroupId |
string |
The ID of the scaling group. |
asg-bp18p2yfxow2dloq**** |
| AutoCreatedCapacity |
string |
The total number of instances in the scaling group that were subject to automatic creation by the scaling group after the scaling activity was executed. |
2 |
| EndTime |
string |
The end time of the scaling activity. |
2020-09-10T09:54Z |
| StartTime |
string |
The start time of the scaling activity. |
2020-09-10T09:54Z |
| Description |
string |
The description of the scaling activity. |
Add \"1\" ECS instance |
| StatusCode |
string |
The status of the scaling activity. Valid values:
|
Successful |
| Cause |
string |
The cause that triggered the scaling activity. |
A user requests to execute scaling rule \"asr-bp12tcnol686y1ik****\", changing the Total Capacity from \"1\" to \"2\". |
| ScalingActivityId |
string |
The ID of the scaling activity. |
asa-bp161xudmuxdzofe**** |
| StatusMessage |
string |
The status message of the scaling activity. |
\"1\" ECS instances are added |
| CreatedCapacity |
integer |
The number of instances created during the current scaling activity. |
1 |
| DestroyedCapacity |
integer |
The number of instances released during the current scaling activity. |
1 |
| StartedCapacity |
integer |
The number of instances started from the Economical Mode (Stopped) state during the current scaling activity. |
1 |
| StoppedCapacity |
integer |
The number of instances that entered the Economical Mode (Stopped) state during the current scaling activity. |
1 |
| CreatedInstances |
object |
||
| CreatedInstance |
array |
The list of instances created during the current scaling activity. |
|
|
string |
The list of instances created during the current scaling activity. |
[ "i-abc1", "i-abc2" ] |
|
| DestroyedInstances |
object |
||
| DestroyedInstance |
array |
The list of instances released during the current scaling activity. |
|
|
string |
The list of instances released during the current scaling activity. |
[ "i-abc1", "i-abc2" ] |
|
| StartedInstances |
object |
||
| StartedInstance |
array |
The list of instances started from the Economical Mode (Stopped) state during the current scaling activity. |
|
|
string |
The list of instances started from the Economical Mode (Stopped) state during the current scaling activity. |
[ "i-abc1", "i-abc2" ] |
|
| StoppedInstances |
object |
||
| StoppedInstance |
array |
The list of instances that entered the Economical Mode (Stopped) state during the current scaling activity. |
|
|
string |
The list of instances that entered the Economical Mode (Stopped) state during the current scaling activity. |
[ "i-abc1", "i-abc2" ] |
|
| ErrorCode |
string |
The error code returned when the scaling activity failed. |
OperationDenied.NoStock |
| ErrorMessage |
string |
The error message returned when the scaling activity failed. |
The specified ECS resource is out of stock in this region. Please try again later. |
| Detail |
string |
The detailed information of the scaling activity. |
"new ECS instances "i-j6c8ilerw, i-j6c8iler4mx" are created." |
| TriggerSourceType |
string |
The type of the trigger source for the scaling activity. Valid values:
|
Api |
| TriggerSourceId |
string |
The ID of the trigger source for the scaling activity. Valid values:
|
2346366580***** |
| LifecycleHookContext |
object |
The context information of lifecycle hooks. |
|
| DisableLifecycleHook |
boolean |
Indicates whether all lifecycle hooks are disabled for the scaling activity. Valid values:
|
false |
| IgnoredLifecycleHookIds |
object |
||
| IgnoredLifecycleHookId |
array |
The list of lifecycle hook IDs that are disabled for the scaling activity. |
|
|
string |
The list of lifecycle hook IDs that are disabled for the scaling activity. |
ash-bp14zolna43z266bq*** |
|
| ActivityMetadata |
string |
The metadata of the scaling activity. |
{\"goatscaler.io/managed\":\"true\"} |
| InstanceRefreshTaskId |
string |
The ID of the instance refresh task. |
ir-asdf12adsxg***** |
| ErrorMessages |
object |
||
| ErrorMessages |
array<object> |
The error messages returned when the scaling activity failed or was partially successful. |
|
|
array<object> |
|||
| Description |
string |
The exception description of the scaling activity. |
Fail to create instances into scaling group. |
| Code |
string |
The error code returned when the scaling activity failed or was partially successful. |
OperationDenied.NoStock |
| Message |
string |
The error messages returned when the scaling activity failed or was partially successful. |
The resource is out of stock in the specified zone. Please try other types, or choose other regions and zones. |
| FailedInstanceIds |
object |
||
| FailedInstanceIds |
array |
The list of failed instance IDs. |
|
|
string |
The instance ID. |
i-8vbedazhjj6a6****** |
Examples
Success response
JSON format
{
"RequestId": "CC107349-57B7-4405-B1BF-9BF5AF7F****",
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 1,
"ScalingActivities": {
"ScalingActivity": [
{
"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": {
"CreatedInstance": [
"[ \"i-abc1\", \"i-abc2\" ]"
]
},
"DestroyedInstances": {
"DestroyedInstance": [
"[ \"i-abc1\", \"i-abc2\" ]"
]
},
"StartedInstances": {
"StartedInstance": [
"[ \"i-abc1\", \"i-abc2\" ]"
]
},
"StoppedInstances": {
"StoppedInstance": [
"[ \"i-abc1\", \"i-abc2\" ]"
]
},
"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": {
"IgnoredLifecycleHookId": [
"ash-bp14zolna43z266bq***"
]
}
},
"ActivityMetadata": "{\\\"goatscaler.io/managed\\\":\\\"true\\\"}",
"InstanceRefreshTaskId": "ir-asdf12adsxg*****",
"ErrorMessages": {
"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": {
"FailedInstanceIds": [
"i-8vbedazhjj6a6******"
]
}
}
]
}
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.