All Products
Search
Document Center

Auto Scaling:DescribeScalingRules

Last Updated:Aug 28, 2026

Queries scaling rules and their details, such as adjustment method, instance warm-up period, and associated event-triggered tasks. You can filter results by scaling rule ID, name, or Alibaba Cloud Resource Name (ARN).

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

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 to which the scaling rules belong.

cn-qingdao

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.

50

ScalingGroupId

string

No

The ID of the scaling group.

asg-bp1ffogfdauy0jw0****

ScalingRuleType

string

No

The type of the scaling rule. Valid values:

  • SimpleScalingRule: adjusts the number of ECS instances based on the values of the AdjustmentType and AdjustmentValue parameters.

  • TargetTrackingScalingRule: calculates the number of ECS instances that need to be scaled in a dynamic manner and maintains the value of a predefined metric close to the value of the TargetValue parameter.

  • StepScalingRule: scales ECS instances in steps based on the specified thresholds and metric values.

  • PredictiveScalingRule: uses machine learning to analyze historical monitoring data of the scaling group and predicts the future values of metrics. In addition, Auto Scaling automatically creates scheduled tasks to adjust the boundary values for the scaling group.

SimpleScalingRule

ShowAlarmRules

boolean

No

Specifies whether to return the event-triggered tasks associated with the scaling rule. Valid values:

  • true

  • false

Default value: false.

false

ScalingRuleIds

array

No

The IDs of the scaling rules that you want to query.

string

No

The IDs of the scaling rules that you want to query.

asr-bp1dvirgwkoowxk7****

ScalingRuleNames

array

No

The names of the scaling rules that you want to query.

string

No

The names of the scaling rules that you want to query.

scalingrule****

ScalingRuleAris

array

No

The unique identifiers of the scaling rules that you want to query.

string

No

The unique identifiers of the scaling rules that you want to query.

ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

PageNumber

integer

The page number of the returned page.

1

PageSize

integer

The number of entries returned per page.

50

TotalCount

integer

The total number of scaling rules.

1

ScalingRules

array<object>

The scaling rules.

array<object>

The scaling rule.

MetricName

string

The name of the metric of the event-triggered task that is associated with the scaling rule.

CpuUtilization

AdjustmentType

string

The adjustment method of the scaling rule. Valid values:

  • QuantityChangeInCapacity: adds or removes the specified number of Elastic Compute Service (ECS) instances to or from the scaling group.

  • PercentChangeInCapacity: adds or removes the specified percentage of ECS instances to or from the scaling group.

  • TotalCapacity: adjusts the number of ECS instances in the scaling group to the specified number.

QuantityChangeInCapacity

InitialMaxSize

integer

The maximum number of ECS instances that can be contained in the scaling group. If you specify this parameter, you must also specify PredictiveValueBehavior.

100

EstimatedInstanceWarmup

integer

The warm-up period of instances. During this period, newly created instances undergo preparation, and their performance metrics are excluded from the monitoring range.

300

ScaleOutEvaluationCount

integer

The number of consecutive times that the event-triggered task created for scale-out purposes must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the rule.

3

PredictiveScalingMode

string

The mode of the predictive scaling rule. Valid values:

  • PredictAndScale: provides predictions and creates prediction tasks.

  • PredictOnly: provides predictions but does not create prediction tasks.

PredictAndScale

MinAdjustmentMagnitude

integer

The minimum number of instances that must be scaled. This parameter takes effect only if you set ScalingRuleType to SimpleScalingRule or StepScalingRule and set AdjustmentType to PercentChangeInCapacity.

1

ScalingRuleAri

string

The unique identifier of the scaling rule.

ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****

PredictiveTaskBufferTime

integer

The amount of buffer time before prediction tasks are executed. By default, all prediction tasks that are automatically created based on a predictive scaling rule are executed on the hour. You can specify a buffer time for resource preparation before prediction tasks are executed. Valid values: 0 to 60. Unit: minutes.

30

MinSize

integer

The minimum number of ECS instances that must be contained in the scaling group.

1

ScalingGroupId

string

The ID of the scaling group.

asg-bp1ffogfdauy0jw0****

PredictiveValueBehavior

string

The action on the predicted maximum value. Valid values:

  • MaxOverridePredictiveValue: uses the initial maximum capacity as the maximum value for prediction tasks if the predicted value is greater than the initial maximum capacity.

  • PredictiveValueOverrideMax: uses the predicted value as the maximum value for prediction tasks when the predicted value is greater than the initial maximum capacity.

  • PredictiveValueOverrideMaxWithBuffer: increases the predicted value by a ratio that is specified by PredictiveValueBuffer, and uses the increased value as the maximum value for prediction tasks if the predicted value increased by this ratio is greater than the initial maximum capacity.

MaxOverridePredictiveValue

TargetValue

number

The target value of the metric. If you set ScalingRuleType to TargetTrackingScalingRule or PredictiveScalingRule, Auto Scaling keeps the metric value close to the target value by adding instances to or removing instances from the scaling group.

0.125

Cooldown

integer

The cooldown period of the scaling rule. This parameter is available only if you set ScalingRuleType to SimpleScalingRule. Valid values: 0 to 86400. Unit: seconds.

20

MaxSize

integer

The maximum number of ECS instances that can be contained in the scaling group.

2

PredictiveValueBuffer

integer

The ratio based on which the predicted value is increased when PredictiveValueBehavior is set to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.

50

ScalingRuleType

string

The type of the scaling rule. Valid values:

  • SimpleScalingRule: a simple scaling rule. Once a simple scaling rule is executed, Auto Scaling adjusts the number of ECS instances in the scaling group based on the values of AdjustmentType and AdjustmentValue.

  • TargetTrackingScalingRule: a target tracking scaling rule. Once a target tracking scaling rule is executed, Auto Scaling dynamically calculates the number of ECS instances or elastic container instances to scale based on the predefined metric (MetricName) and attempts to maintain the metric value close to the specified target value (TargetValue).

  • StepScalingRule: a step scaling rule. Once a step scaling rule is executed, Auto Scaling scales instances step by step based on the predefined thresholds and metric values.

  • PredictiveScalingRule: a predictive scaling rule. Once a predictive scaling rule is executed, Auto Scaling analyzes the historical monitoring data based on the machine learning technology and predicts the trends of metric data. Auto Scaling also creates scheduled tasks to enable dynamic adjustment of the boundary values for the scaling group.

SimpleScalingRule

AdjustmentValue

integer

The number of instances that must be scaled based on the scaling rule.

1

ScaleInEvaluationCount

integer

The number of consecutive times that the event-triggered task for scale-in purposes must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the rule.

15

DisableScaleIn

boolean

Indicates whether scale-in is disabled. This parameter takes effect only if you set ScalingRuleType to TargetTrackingScalingRule. Valid values:

  • true

  • false

true

ScalingRuleName

string

The name of the scaling rule.

scalingrule****

ScalingRuleId

string

The ID of the scaling rule.

asr-bp1dvirgwkoowxk7****

Alarms

array<object>

The event-triggered tasks associated with the scaling rule. Returned only if ShowAlarmRules is set to true. Otherwise, null is returned.

array<object>

The event-triggered task associated with the scaling rule. Returned only if ShowAlarmRules is set to true. Otherwise, null is returned.

AlarmTaskId

string

The ID of the event-triggered task that is associated with the scaling rule.

asg-bp18p2yfxow2dloq****_1f9458d1-70e1-4bee-8c7f-7a47695b****

ComparisonOperator

string

The comparison operator between the statistical value and the threshold of the metric in the associated event-triggered task. It indicates the relationship that must be met to trigger an alert.

  • Valid value if the metric value is greater than or equal to the threshold: >=

  • Valid value if the metric value is less than or equal to the threshold: <=

  • Valid value if the metric value is greater than the threshold: >

  • Valid value if the metric value is less than the threshold: <

>=

MetricName

string

The name of the metric of the event-triggered task that is associated with the scaling rule.

CpuUtilization

EvaluationCount

integer

The number of consecutive times the associated event-triggered task must meet the alert condition before an alert is triggered.

3

AlarmTaskName

string

The name of the event-triggered task that is associated with the scaling rule.

alarmtask****

MetricType

string

The type of the metric of the event-triggered task that is associated with the scaling rule. Valid values:

  • system: system metrics

  • custom: custom metrics

system

Threshold

number

The alert threshold of the event-triggered task that is associated with the scaling rule.

50

Statistics

string

The statistical method of the event-triggered task that is associated with the scaling rule. Valid values:

  • Average

  • Maximum

  • Minimum

Average

Dimensions

array<object>

The dimensions of the event-triggered task that is associated with the scaling rule.

object

The dimensions of the event-triggered task that is associated with the scaling rule.

DimensionKey

string

The key of the dimension that is associated with the metric. Valid values:

  • ScalingGroupId: the ID of the scaling group.

  • userId: the ID of the user account.

scaling_group

DimensionValue

string

The value of the dimension that is associated with the metric.

asg-bp18p2yfxow2dloq****

Period

integer

The statistical period of the metric data in the target tracking scaling rule.

60

StepAdjustments

array<object>

The step adjustments of the step scaling rule.

object

The step adjustments of the step scaling rule.

MetricIntervalUpperBound

number

The upper limit of a step adjustment. Valid values: -9.999999E18 to 9.999999E18.

5.0

ScalingAdjustment

integer

The number of ECS instances that are scaled in a step adjustment.

1

MetricIntervalLowerBound

number

The lower limit of a step adjustment. Valid values: -9.999999E18 to 9.999999E18.

1.0

AlarmDimensions

array<object>

The dimensions. Applicable to target tracking scaling rules when your predefined metric requires extra dimensions. For example, if you predefine the LoadBalancerRealServerAverageQps metric, you must use this parameter to specify the rulePool dimension.

object

DimensionKey

string

The dimension key of the metric.

rulePool

DimensionValue

string

The dimension value of the metric.

sgp-l1cbirz451yxu2dxxx

MetricType

string

The metric type. Valid values:

  • system: system metrics of CloudMonitor.

  • custom: custom metrics that are reported to CloudMonitor.

  • hybrid: metrics of Hybrid Cloud Monitoring.

system

HybridMonitorNamespace

string

The ID of the Hybrid Cloud Monitoring namespace.

For information about how to manage Hybrid Cloud Monitoring namespaces, see Manage namespaces.

aliyun-test

HybridMetrics

array<object>

The Hybrid Cloud Monitoring metrics. For more information, see Create a custom target tracking scaling rule.

array<object>

Id

string

The reference ID of the metric in the metric expression.

a

Expression

string

The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. The calculated result is used to trigger scaling events.

The expression is written in Reverse Polish Notation (RPN) format and supports only the following operators: +, -, *, /.

(a+b)/2

MetricName

string

The name of the Hybrid Cloud Monitoring metric.

AliyunSmq_NumberOfMessagesVisible

Statistic

string

The statistical method of the metric value. Valid values:

  • Average: The average value of all metric values within a specified interval is calculated.

  • Minimum: The minimum value of all metric values within a specified interval is calculated.

  • Maximum: The maximum value of all metric values within a specified interval is calculated.

Average

Dimensions

array<object>

The metric dimensions. Used to specify the monitored resources.

object

DimensionKey

string

The key of the metric dimension.

queue

DimensionValue

string

The key of the metric dimension.

testQueue

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PageNumber": 1,
  "PageSize": 50,
  "TotalCount": 1,
  "ScalingRules": [
    {
      "MetricName": "CpuUtilization",
      "AdjustmentType": "QuantityChangeInCapacity",
      "InitialMaxSize": 100,
      "EstimatedInstanceWarmup": 300,
      "ScaleOutEvaluationCount": 3,
      "PredictiveScalingMode": "PredictAndScale",
      "MinAdjustmentMagnitude": 1,
      "ScalingRuleAri": "ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****",
      "PredictiveTaskBufferTime": 30,
      "MinSize": 1,
      "ScalingGroupId": "asg-bp1ffogfdauy0jw0****",
      "PredictiveValueBehavior": "MaxOverridePredictiveValue",
      "TargetValue": 0.125,
      "Cooldown": 20,
      "MaxSize": 2,
      "PredictiveValueBuffer": 50,
      "ScalingRuleType": "SimpleScalingRule",
      "AdjustmentValue": 1,
      "ScaleInEvaluationCount": 15,
      "DisableScaleIn": true,
      "ScalingRuleName": "scalingrule****",
      "ScalingRuleId": "asr-bp1dvirgwkoowxk7****",
      "Alarms": [
        {
          "AlarmTaskId": "asg-bp18p2yfxow2dloq****_1f9458d1-70e1-4bee-8c7f-7a47695b****",
          "ComparisonOperator": ">=",
          "MetricName": "CpuUtilization",
          "EvaluationCount": 3,
          "AlarmTaskName": "alarmtask****",
          "MetricType": "system",
          "Threshold": 50,
          "Statistics": "Average",
          "Dimensions": [
            {
              "DimensionKey": "scaling_group",
              "DimensionValue": "asg-bp18p2yfxow2dloq****"
            }
          ],
          "Period": 60
        }
      ],
      "StepAdjustments": [
        {
          "MetricIntervalUpperBound": 5,
          "ScalingAdjustment": 1,
          "MetricIntervalLowerBound": 1
        }
      ],
      "AlarmDimensions": [
        {
          "DimensionKey": "rulePool",
          "DimensionValue": "sgp-l1cbirz451yxu2dxxx"
        }
      ],
      "MetricType": "system",
      "HybridMonitorNamespace": "aliyun-test",
      "HybridMetrics": [
        {
          "Id": "a",
          "Expression": "(a+b)/2",
          "MetricName": "AliyunSmq_NumberOfMessagesVisible",
          "Statistic": "Average",
          "Dimensions": [
            {
              "DimensionKey": "queue",
              "DimensionValue": "testQueue"
            }
          ]
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.