All Products
Search
Document Center

Auto Scaling:DescribeScalingActivities

Last Updated:Aug 28, 2026

Queries scaling activities triggered by scheduled tasks, event-triggered tasks, or manual execution of scaling rules. You can view the status, cause, and total number of instances after a scaling activity is complete.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:DescribeScalingActivities

get

*ScalingGroup

acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the scaling group.

cn-hangzhou

PageNumber

integer

No

The page number. Pages start from page 1.

Default value: 1.

1

PageSize

integer

No

The number of entries per 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 following parameters: ScalingGroupId and ScalingActivityIds. You cannot specify both of them at the same time. If you specify neither of them, an error is reported.

asg-bp18p2yfxow2dloq****

StatusCode

string

No

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

ScalingActivityIds

array

No

The IDs of the scaling activities.

Note

When you call this operation, you must specify one of the following parameters: ScalingGroupId and ScalingActivityIds. You cannot specify both of them at the same time. If you specify neither of them, an error is reported.

string

No

The ID of the scaling activity.

Note

When you call this operation, you must specify one of the following parameters: ScalingGroupId and ScalingActivityIds. You cannot specify both of them at the same time. If you specify neither of them, an error is reported.

asa-bp161xudmuxdzofe****

InstanceRefreshTaskId

string

No

The ID of the instance refresh task. If specified, this operation returns the scaling activities associated with the task.

ir-a12ds234fasd*****

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

CC107349-57B7-4405-B1BF-9BF5AF7F2A46

PageNumber

integer

The page number of the returned page.

1

PageSize

integer

The number of entries returned per page.

10

TotalCount

integer

The total number of scaling activities.

1

ScalingActivities

array<object>

The scaling activities.

array<object>

The scaling activity.

Progress

integer

The execution progress of the scaling activity.

100

ScalingInstanceNumber

integer

  • For a scale-out activity, this value indicates the number of instances that are created or started from Economical Mode.

  • For a scale-in activity, this value indicates the number of instances that are deleted or stopped in Economical Mode.

1

AttachedCapacity

string

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

0

TotalCapacity

string

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

2

ScalingGroupId

string

The ID of the scaling group.

asg-bp18p2yfxow2dloq****

AutoCreatedCapacity

string

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

2

EndTime

string

The time when the scaling activity is complete.

2020-09-10T09:54Z

StartTime

string

The time when the scaling activity started.

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: 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

Cause

string

The reason why the scaling activity was triggered.

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 that are created during the scale-out event.

1

DestroyedCapacity

integer

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

1

StartedCapacity

integer

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

1

StoppedCapacity

integer

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

1

CreatedInstances

array

The instances that are created during the scale-out event.

string

The instances that are created during the scale-out event.

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

DestroyedInstances

array

The instances that are released during the scale-in event.

string

The instances that are released during the scale-in event.

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

StartedInstances

array

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

string

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

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

StoppedInstances

array

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

string

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

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

ErrorCode

string

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

OperationDenied.NoStock

ErrorMessage

string

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.

Detail

string

Details of the scaling activity.

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

TriggerSourceType

string

The type of the trigger source of the scaling activity. Valid values:

  • Cms: The scaling activity is triggered by an event-triggered task.

  • APIs: The scaling activity is triggered by calling an API operation.

  • Ess: The scaling activity is triggered by Auto Scaling.

Api

TriggerSourceId

string

The ID of the trigger source of the scaling activity. Valid values:

  • If triggered by an event-triggered task, this is the task ID.

  • If triggered by an API operation, this is the Alibaba Cloud account or Resource Access Management (RAM) user ID used to call the operation.

  • If triggered by Auto Scaling, this value is null.

2346366580*****

LifecycleHookContext

object

The context of the lifecycle hook.

DisableLifecycleHook

boolean

Indicates whether all lifecycle hooks are disabled when the scaling activity is triggered.

  • true

  • false

false

IgnoredLifecycleHookIds

array

The IDs of the lifecycle hooks that are disabled.

string

The ID of the lifecycle hook that is disabled.

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

array<object>

The error messages that are returned when the scaling activities failed or are partially successful.

object

Description

string

The description of the scaling activity exception.

Fail to create instances into scaling group.

Code

string

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

OperationDenied.NoStock

Message

string

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

The resource is out of stock in the specified zone. Please try other types, or choose other regions and zones.

FailedInstanceIds

array

The IDs of the instances included in the failed scaling activities.

string

The ID of the instance included in the failed scaling activity.

i-8vbedazhjj6a6******

Examples

Success response

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": "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******"
          ]
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.