Queries scaling activities.
Operation description
You can specify a scaling group ID to query all scaling activities in the scaling group.
You can filter query results based on the status of scaling activities.
You can query scaling activities that are executed in the previous 30 days.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ess:DescribeScalingActivities | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the scaling group to which the scaling activity that you want to query belongs. | cn-hangzhou |
PageNumber | integer | No | The number of the page to return. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return on each page. 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 one of the ScalingGroupId and ScalingActivityId.N parameters. Otherwise, an error is reported.
| asg-bp18p2yfxow2dloq**** |
StatusCode | string | No | The status of the scaling activity. Valid values:
| Successful |
ScalingActivityIds | array | No | The IDs of the scaling activities that you want to query. Note
When you call this operation, you must specify one of the ScalingGroupId and ScalingActivityId.N parameters. Otherwise, an error is reported.
| |
string | No | The IDs of the scaling activities that you want to query. Note
When you call this operation, you must specify one of the ScalingGroupId and ScalingActivityId.N parameters. Otherwise, an error is reported.
| asa-bp161xudmuxdzofe**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "CC107349-57B7-4405-B1BF-9BF5AF7F2A46",
"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": "",
"TriggerSourceId": "",
"LifecycleHookContext": {
"DisableLifecycleHook": true,
"IgnoredLifecycleHookIds": [
""
]
},
"ActivityMetadata": ""
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2024-03-13 | The response structure of the API has changed | see changesets | ||
| ||||
2022-12-16 | The response structure of the API has changed | see changesets | ||
|