All Products
Search
Document Center

Auto Scaling:DescribeScalingRules

Last Updated:Sep 10, 2026

Queries the scaling rules in a scaling group and returns information about the scaling rules.

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 of the scaling rule list. Minimum value: 1.

Default value: 1.

1

PageSize

integer

No

The number of entries per page for paging queries. Settings: 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: simple scaling. Adjusts the number of ECS instances based on the adjustment method (AdjustmentType) and adjustment value (AdjustmentValue).

  • TargetTrackingScalingRule: target tracking scaling rule. Dynamically calculates the number of ECS instances to scale out or scale in based on the predefined monitoring metric (MetricName) and attempts to keep the monitoring metric value close to the target value (TargetValue).

  • StepScalingRule: step scaling rule. Provides step-based extension based on thresholds and metric values.

  • PredictiveScalingRule: predictive scaling rule. Uses machine learning to analyze historical monitoring data of the scaling group, predict future monitoring metric values, and supports automatic creation of scheduled nodes to configure scaling group boundaries.

SimpleScalingRule

ShowAlarmRules

boolean

No

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

  • true: Returns the CloudMonitor event-triggered tasks associated with the scaling rules.

  • false: Does not return the CloudMonitor event-triggered tasks associated with the scaling rules.

Default value: false.

false

ScalingRuleId

array

No

The ID of scaling rule N that you want to query. Valid values of N: 1 to 10.

asr-bp1dvirgwkoowxk7****

string

No

The ID of scaling rule N that you want to query. Valid values of N: 1 to 10.

asr-bp1dvirgwkoowxk7****

ScalingRuleName

array

No

The name of scaling rule N that you want to query. Valid values of N: 1 to 10.

scalingrule****

string

No

The name of scaling rule N that you want to query. Valid values of N: 1 to 10.

scalingrule****

ScalingRuleAri

array

No

The unique identifier of scaling rule N that you want to query. Valid values of N: 1 to 10.

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

string

No

The unique identifier of scaling rule N that you want to query. Valid values of N: 1 to 10.

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

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

PageNumber

integer

The current page number.

1

PageSize

integer

The number of entries per page.

50

TotalCount

integer

The total number of scaling rules.

1

ScalingRules

object

ScalingRule

array<object>

The collection of scaling rule information.

array<object>

The collection of scaling rule information.

MetricName

string

The predefined metric of the scaling rule. If you set ScalingRuleType to TargetTrackingScalingRule or PredictiveScalingRule, you must specify this parameter.

Valid values if ScalingRuleType is set to TargetTrackingScalingRule:

  • CpuUtilization: the average CPU utilization

  • ClassicInternetRx: the average inbound Internet traffic over the classic network

  • ClassicInternetTx: the average outbound Internet traffic over the classic network

  • VpcInternetRx: the average inbound Internet traffic over a virtual private cloud (VPC)

  • VpcInternetTx: the average outbound Internet traffic over a VPC

  • IntranetRx: the average inbound traffic over the internal network

  • IntranetTx: the average outbound traffic over the internal network

    Valid values if ScalingRuleType is set to PredictiveScalingRule:

  • CpuUtilization: the average CPU utilization

  • IntranetRx: the average inbound traffic over the internal network

  • IntranetTx: the average outbound traffic over the internal network

CpuUtilization

AdjustmentType

string

The adjustment method of the scaling rule. Valid values:

  • QuantityChangeInCapacity: adds the specified number of ECS instances to or removes the specified number of ECS instances from the scaling group.

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

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

QuantityChangeInCapacity

InitialMaxSize

integer

The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.

100

EstimatedInstanceWarmup

integer

The warmup period of an ECS instance.

300

ScaleOutEvaluationCount

integer

The number of consecutive times that the event-triggered task created for scale-outs 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 target tracking scaling 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 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 the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.

30

MinSize

integer

The minimum number of ECS instances that the scaling group must contain.

1

ScalingGroupId

string

The ID of the scaling group whose scaling rules are queried.

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 if 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 the ratio is greater than the initial maximum capacity.

MaxOverridePredictiveValue

TargetValue

number

The target value.

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 the scaling group can contain.

2

PredictiveValueBuffer

integer

The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value that is 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: adjusts the number of ECS instances based on the values of AdjustmentTyp****e and AdjustmentValue.

  • TargetTrackingScalingRule: calculates the number of ECS instances that must be scaled and maintains the value of a predefined metric close to the value of TargetValue.

  • 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 creates scheduled tasks to adjust the minimum and maximum numbers of instances for the scaling group.

SimpleScalingRule

AdjustmentValue

integer

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

1

ScaleInEvaluationCount

integer

The number of consecutive times that the event-triggered task created for scale-ins 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 target tracking scaling rule.

15

DisableScaleIn

boolean

Indicates whether to disable scale-in. 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

object

Alarm

array<object>

The event-triggered tasks that are associated with the scaling rule. This parameter is returned only if you set ShowAlarmRules to true. Otherwise, an empty list is returned.

array<object>

The CloudMonitor event-triggered tasks associated with the scaling rule. The CloudMonitor event-triggered tasks associated with the scaling rule are returned only when the ShowAlarmRules parameter is set to true; otherwise, an empty list 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 event-triggered task that is associated with the scaling rule. The comparison operator indicates the relationship in which the metric value and the metric threshold can meet the alert condition.

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

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

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

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

>=

MetricName

string

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

CpuUtilization

EvaluationCount

integer

The number of consecutive times that the event-triggered task that is associated with the scaling rule 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 in the event-triggered task that is associated with the scaling rule. Valid values:

  • system: system metric

  • custom: custom metric

system

Threshold

number

The threshold of the metric in 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

object

Dimension

array<object>

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

object

The dimension information of the event-triggered task associated with the scaling rule.

DimensionKey

string

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

  • scaling_group: the ID of the scaling group

  • userId: the ID of the Alibaba Cloud account

scaling_group

DimensionValue

string

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

asg-bp18p2yfxow2dloq****

Period

integer

The epoch for collecting metric data in a target tracking rule.

60

StepAdjustments

object

StepAdjustment

array<object>

The step adjustments of the step scaling rule.

object

The upper limit that is specified in a step adjustment. Valid values: -9.999999E18 to 9.999999E18.

MetricIntervalUpperBound

number

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

5.0

ScalingAdjustment

integer

The lower limit that is specified in a step adjustment. Valid values: -9.999999E18 to 9.999999E18.

1

MetricIntervalLowerBound

number

auditing

1.0

AlarmDimensions

object

AlarmDimension

array<object>

The dimension information associated with the metric. This applies to target tracking rules and is set when the metric requires additional dimension information. For example, the LoadBalancerRealServerAverageQps metric requires the rulePool dimension.

object

The dimension information associated with the metric. This applies to target tracking rules and is set when the metric requires additional dimension information. For example, the LoadBalancerRealServerAverageQps metric requires the rulePool dimension.

DimensionKey

string

The key of the dimension associated with the metric.

rulePool

DimensionValue

string

The value of the dimension associated with the metric.

sgp-l1cbirz451yxu2****

MetricType

string

The type of metric. Valid values:

  • system: Uses CloudMonitor system metrics.

  • custom: Uses Custom Metrics reported to CloudMonitor.

  • hybrid: Uses Hybrid Cloud Monitoring metrics.

system

HybridMonitorNamespace

string

The ID of the Hybrid Cloud Monitoring metric repository.

For information about managing metric repositories, see Manage metric repositories.

aliyun-test

HybridMetrics

object

HybridMetric

array<object>

Settings for Hybrid Cloud Monitoring metrics. For more information about how to configure these settings, see Use formulas to create custom target tracking rules.

array<object>

Id

string

Reference ID of the Metric in the metric expression.

a

Expression

string

An expression for arithmetic operations on multiple Hybrid Cloud Monitoring metrics. The result of this expression is used to trigger scale-out or scale-in.

The expression must comply with the Reverse Polish Notation (RPN) specification, and the supported operators are + - * / only.

(a+b)/2

MetricName

string

The metric name in the Hybrid Cloud Monitoring metric repository.

AliyunSmq_NumberOfMessagesVisible

Statistic

string

The statistic method of the metric. Valid values:

  • Average: the average value of all points in the specified interval.

  • Minimum: the minimum value of all points in the specified interval.

  • Maximum: the maximum value of all points in the specified interval.

Average

Dimensions

object

Dimension

array<object>

The metric dimensions. Used to specify the resources monitored by the metric.

object

DimensionKey

string

Metric dimension key.

queue

DimensionValue

string

Metric dimension value.

testQueue

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PageNumber": 1,
  "PageSize": 50,
  "TotalCount": 1,
  "ScalingRules": {
    "ScalingRule": [
      {
        "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": {
          "Alarm": [
            {
              "AlarmTaskId": "asg-bp18p2yfxow2dloq****_1f9458d1-70e1-4bee-8c7f-7a47695b****",
              "ComparisonOperator": ">=",
              "MetricName": "CpuUtilization",
              "EvaluationCount": 3,
              "AlarmTaskName": "alarmtask****",
              "MetricType": "system",
              "Threshold": 50,
              "Statistics": "Average",
              "Dimensions": {
                "Dimension": [
                  {
                    "DimensionKey": "scaling_group",
                    "DimensionValue": "asg-bp18p2yfxow2dloq****"
                  }
                ]
              },
              "Period": 60
            }
          ]
        },
        "StepAdjustments": {
          "StepAdjustment": [
            {
              "MetricIntervalUpperBound": 5,
              "ScalingAdjustment": 1,
              "MetricIntervalLowerBound": 1
            }
          ]
        },
        "AlarmDimensions": {
          "AlarmDimension": [
            {
              "DimensionKey": "rulePool",
              "DimensionValue": "sgp-l1cbirz451yxu2****"
            }
          ]
        },
        "MetricType": "system",
        "HybridMonitorNamespace": "aliyun-test",
        "HybridMetrics": {
          "HybridMetric": [
            {
              "Id": "a",
              "Expression": "(a+b)/2",
              "MetricName": "AliyunSmq_NumberOfMessagesVisible",
              "Statistic": "Average",
              "Dimensions": {
                "Dimension": [
                  {
                    "DimensionKey": "queue",
                    "DimensionValue": "testQueue"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.