All Products
Search
Document Center

Auto Scaling:DescribeScalingActivities

Last Updated:May 16, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ess:DescribeScalingActivitiesRead
  • ScalingGroup
    acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the scaling group to which the scaling activity that you want to query belongs.

cn-hangzhou
PageNumberintegerNo

The number of the page to return. Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page. Maximum value: 50.

Default value: 10.

10
ScalingGroupIdstringNo

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****
StatusCodestringNo

The status of the scaling activity. Valid values:

  • Successful: The scaling activity is successful.
  • Warning: The scaling activity is partially successful.
  • Failed: The scaling activity failed.
  • InProgress: The scaling activity is in progress.
  • Rejected: The request to trigger the scaling activity is rejected.
Successful
ScalingActivityIdsarrayNo

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.
stringNo

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

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

CC107349-57B7-4405-B1BF-9BF5AF7F2A46
PageNumberinteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

10
TotalCountinteger

The total number of scaling activities.

1
ScalingActivitiesobject []

The information about the scaling activities.

Progressinteger

The execution progress of the scaling activity.

100
ScalingInstanceNumberinteger

If you query a scale-out, the value of this parameter indicates the number of instances that are created or the number of instances that are started from the Economical Mode during the scale-out.

If you query a scale-in, the value of this parameter indicates the number of instances that are deleted or the number of instances that are stopped in the Economical Mode during the scale-in.

1
AttachedCapacitystring

The total number of instances that are manually added to the scaling group after the scaling activity is complete.

0
TotalCapacitystring

The total number of instances in the scaling group after the scaling activity is complete.

2
ScalingGroupIdstring

The ID of the scaling group.

asg-bp18p2yfxow2dloq****
AutoCreatedCapacitystring

The total number of instances that are created by Auto Scaling after the scaling activity is complete.

2
EndTimestring

The time when the scaling activity is complete.

2020-09-10T09:54Z
StartTimestring

The time when the scaling activity is started.

2020-09-10T09:54Z
Descriptionstring

The description of the scaling activity.

Add \"1\" ECS instance
StatusCodestring

The status of the scaling activity. Valid values:

  • Successful: The scaling activity is successful.
  • Warning: The scaling activity is partially successful.
  • Failed: The scaling activity failed.
  • InProgress: The scaling activity is in progress.
  • Rejected: The request to trigger the scaling activity is rejected.
Successful
Causestring

The reason why the scaling activity is triggered.

A user requests to execute scaling rule \"asr-bp12tcnol686y1ik****\", changing the Total Capacity from \"1\" to \"2\".
ScalingActivityIdstring

The ID of the scaling activity.

asa-bp161xudmuxdzofe****
StatusMessagestring

The status message of the scaling activity.

\"1\" ECS instances are added
CreatedCapacityinteger

The number of instances that are created during the scale-out.

1
DestroyedCapacityinteger

The number of instances that are released during the scale-in.

1
StartedCapacityinteger

The number of instances that are started from the Economical Mode during the scale-out.

1
StoppedCapacityinteger

The number of instances that are stopped in the Economical Mode during the scale-in.

1
CreatedInstancesarray

The instances that are created during the scale-out.

string

The instances that are created during the scale-out.

["i-abc1","i-abc2"]
DestroyedInstancesarray

The instances that are released during the scale-in.

string

The instances that are released during the scale-in.

[ "i-abc1", "i-abc2" ]
StartedInstancesarray

The instances that are started from the Economical Mode during the scale-out.

string

The instances that are started from the Economical Mode during the scale-out.

[ "i-abc1", "i-abc2" ]
StoppedInstancesarray

The instances that are stopped in the Economical Mode during the scale-in.

string

The instances that are stopped in the Economical Mode during the scale-in.

[ "i-abc1", "i-abc2" ]
ErrorCodestring

The error code that is returned when the scaling activity failed.

OperationDenied.NoStock
ErrorMessagestring

The error message that is returned when the scaling activity failed.

The specified ECS resource is out of stock in this region. Please try again later.
Detailstring

Details of the scaling activity.

"new ECS instances "i-j6c8ilerw, i-j6c8iler4mx" are created."

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2024-03-13The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2022-12-16The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.