Queries one or more scaling activities.
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
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeScalingActivities | The operation that you want to perform. Set the value to DescribeScalingActivities. |
RegionId | String | Yes | cn-hangzhou | The region ID of the scaling group to which the scaling activity that you want to query belongs. |
PageNumber | Integer | No | 1 | The number of the page to return. Pages start from page 1. Default value: 1. |
PageSize | Integer | No | 10 | The number of entries to return on each page. Maximum value: 50. Default value: 10. |
ScalingGroupId | String | No | asg-bp18p2yfxow2dloq**** | The ID of the scaling group. Note When you call this operation, you must specify a value for the ScalingGroupId or ScalingActivityId.N parameter. Otherwise, an error is reported when you call this operation. |
StatusCode | String | No | Successful | The status of the scaling activity. Valid values:
|
ScalingActivityId.N | String | No | asa-bp161xudmuxdzofe**** | The ID of scaling activity N that you want to query. Note When you call this operation, you must specify a value for the ScalingGroupId or ScalingActivityId.N parameter. Otherwise, an error is reported when you call this operation. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | CC107349-57B7-4405-B1BF-9BF5AF7F**** | The ID of the request. |
PageNumber | Integer | 1 | The page number of the returned page. |
PageSize | Integer | 10 | The number of entries returned per page. |
TotalCount | Integer | 1 | The total number of scaling activities. |
ScalingActivities | Array of ScalingActivity | Details of the scaling activities. |
|
ScalingActivity | |||
Progress | Integer | 100 | The execution progress of the scaling activity. |
ScalingInstanceNumber | Integer | 1 |
|
AttachedCapacity | String | 0 | The total number of instances that were manually added to the scaling group after the scaling activity was complete. |
TotalCapacity | String | 2 | The total number of instances in the scaling group after the scaling activity was complete. |
ScalingGroupId | String | asg-bp18p2yfxow2dloq**** | The ID of the scaling group. |
AutoCreatedCapacity | String | 2 | The total number of instances that were automatically created by Auto Scaling after the scaling activity was complete. |
EndTime | String | 2020-09-10T09:54Z | The time when the scaling activity was complete. |
StartTime | String | 2020-09-10T09:54Z | The time when the scaling activity started. |
Description | String | Add \"1\" ECS instance | The description of the scaling activity. |
StatusCode | String | Successful | The status of the scaling activity. Valid values:
|
Cause | String | A user requests to execute scaling rule \"asr-bp12tcnol686y1ik****\", changing the Total Capacity from \"1\" to \"2\". | The reason why the scaling activity was triggered. |
ScalingActivityId | String | asa-bp161xudmuxdzofe**** | The ID of the scaling activity. |
StatusMessage | String | \"1\" ECS instances are added | The status information about the scaling activity. |
CreatedCapacity | Integer | 1 | The number of instances that were created during the scaling activity. |
DestroyedCapacity | Integer | 1 | The number of instances that were released during the scaling activity. |
StartedCapacity | Integer | 1 | The number of instances that were started from Economical Mode during the scaling activity. |
StoppedCapacity | Integer | 1 | The number of instances that were stopped in Economical Mode during the scaling activity. |
CreatedInstances | Array of String | ["i-abc1","i-abc2"] | The instances that were created during the scaling activity. |
DestroyedInstances | Array of String | [ "i-abc1", "i-abc2" ] | The instances that were released during the scaling activity. |
StartedInstances | Array of String | [ "i-abc1", "i-abc2" ] | The instances that were started from Economical Mode during the scaling activity. |
StoppedInstances | Array of String | [ "i-abc1", "i-abc2" ] | The instances that were stopped in Economical Mode during the scaling activity. |
ErrorCode | String | OperationDenied.NoStock | The error code that is returned when the scaling activity fails. |
ErrorMessage | String | The specified ECS resource is out of stock in this region. Please try again later. | The error message that is returned when the scaling activity fails. |
Detail | String | "new ECS instances "i-j6c8ilerw, i-j6c8iler4mx" are created." | Details of the scaling activity. |
Examples
Sample requests
http(s)://ess.aliyuncs.com/?Action=DescribeScalingActivities
&RegionId=cn-hangzhou
&PageNumber=1
&PageSize=10
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&StatusCode=Successful
&ScalingActivityId=["asa-bp161xudmuxdzofe****"]
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeScalingActivitiesResponse>
<RequestId>CC107349-57B7-4405-B1BF-9BF5AF7F****</RequestId>
<PageNumber>1</PageNumber>
<PageSize>10</PageSize>
<TotalCount>1</TotalCount>
<ScalingActivities>
<Progress>100</Progress>
<ScalingInstanceNumber>1</ScalingInstanceNumber>
<AttachedCapacity>0</AttachedCapacity>
<TotalCapacity>2</TotalCapacity>
<ScalingGroupId>asg-bp18p2yfxow2dloq****</ScalingGroupId>
<AutoCreatedCapacity>2</AutoCreatedCapacity>
<EndTime>2020-09-10T09:54Z</EndTime>
<StartTime>2020-09-10T09:54Z</StartTime>
<Description>Add \"1\" ECS instance</Description>
<StatusCode>Successful</StatusCode>
<Cause>A user requests to execute scaling rule \"asr-bp12tcnol686y1ik****\", changing the Total Capacity from \"1\" to \"2\".</Cause>
<ScalingActivityId>asa-bp161xudmuxdzofe****</ScalingActivityId>
<StatusMessage>\"1\" ECS instances are added</StatusMessage>
<CreatedCapacity>1</CreatedCapacity>
<DestroyedCapacity>1</DestroyedCapacity>
<StartedCapacity>1</StartedCapacity>
<StoppedCapacity>1</StoppedCapacity>
<CreatedInstances>["i-abc1","i-abc2"]</CreatedInstances>
<DestroyedInstances>[ "i-abc1", "i-abc2" ]</DestroyedInstances>
<StartedInstances>[ "i-abc1", "i-abc2" ]</StartedInstances>
<StoppedInstances>[ "i-abc1", "i-abc2" ]</StoppedInstances>
<ErrorCode>OperationDenied.NoStock</ErrorCode>
<ErrorMessage>The specified ECS resource is out of stock in this region. Please try again later.</ErrorMessage>
<Detail>"new ECS instances "i-j6c8ilerw, i-j6c8iler4mx" are created."</Detail>
</ScalingActivities>
</DescribeScalingActivitiesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/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" : [ "[ \"i-abc1\", \"i-abc2\" ]" ],
"StartedInstances" : [ "[ \"i-abc1\", \"i-abc2\" ]" ],
"StoppedInstances" : [ "[ \"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.\""
} ]
}
Error codes
For a list of error codes, see Service error codes.