All Products
Search
Document Center

Auto Scaling:DescribeScalingRules

Last Updated:Sep 10, 2026

Mengkueri aturan penskalaan dalam grup penskalaan dan mengembalikan informasi tentang aturan penskalaan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

ess:DescribeScalingRules

get

*ScalingGroup

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

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID wilayah grup penskalaan tempat aturan penskalaan berada.

cn-qingdao

PageNumber

integer

No

Nomor halaman daftar aturan penskalaan. Nilai minimum: 1.

Nilai default: 1.

1

PageSize

integer

No

Jumlah entri per halaman untuk kueri penomoran halaman. Nilai maksimum: 50.

Nilai default: 10.

50

ScalingGroupId

string

No

ID grup penskalaan.

asg-bp1ffogfdauy0jw0****

ScalingRuleType

string

No

Tipe aturan penskalaan. Nilai valid:

  • SimpleScalingRule: skalabilitas sederhana. Menyesuaikan jumlah instans ECS berdasarkan metode penyesuaian (AdjustmentType) dan nilai penyesuaian (AdjustmentValue).

  • TargetTrackingScalingRule: aturan penskalaan pelacakan target. Menghitung secara dinamis jumlah instans ECS untuk melakukan scale out atau scale in berdasarkan data deret waktu pemantauan yang telah ditentukan sebelumnya (MetricName) dan berupaya menjaga nilai data deret waktu pemantauan mendekati nilai target (TargetValue).

  • StepScalingRule: aturan penskalaan bertahap. Menyediakan ekstensi berbasis langkah berdasarkan ambang batas dan nilai data deret waktu.

  • PredictiveScalingRule: aturan penskalaan memprediksi. Menggunakan pembelajaran mesin untuk menganalisis data historis pemantauan grup penskalaan, memprediksi nilai data deret waktu pemantauan di masa mendatang, dan mendukung pembuatan otomatis Tugas terjadwal untuk mengonfigurasi batas grup penskalaan.

SimpleScalingRule

ShowAlarmRules

boolean

No

Apakah akan mengembalikan tugas Pemicu event CloudMonitor yang terkait dengan aturan penskalaan. Nilai valid:

  • true: Mengembalikan tugas Pemicu event CloudMonitor yang terkait dengan aturan penskalaan.

  • false: Tidak mengembalikan tugas Pemicu event CloudMonitor yang terkait dengan aturan penskalaan.

Nilai default: false.

false

ScalingRuleId

array

No

ID aturan penskalaan N yang ingin Anda kueri. Nilai valid untuk N: 1 hingga 10.

asr-bp1dvirgwkoowxk7****

string

No

ID aturan penskalaan N yang ingin Anda kueri. Nilai valid untuk N: 1 hingga 10.

asr-bp1dvirgwkoowxk7****

ScalingRuleName

array

No

Nama aturan penskalaan N yang ingin Anda kueri. Nilai valid untuk N: 1 hingga 10.

scalingrule****

string

No

Nama aturan penskalaan N yang ingin Anda kueri. Nilai valid untuk N: 1 hingga 10.

scalingrule****

ScalingRuleAri

array

No

Pengenal unik aturan penskalaan N yang ingin Anda kueri. Nilai valid untuk N: 1 hingga 10.

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

string

No

Pengenal unik aturan penskalaan N yang ingin Anda kueri. Nilai valid untuk N: 1 hingga 10.

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

Elemen respons

Element

Type

Description

Example

object

RequestId

string

ID permintaan.

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

PageNumber

integer

Nomor halaman saat ini.

1

PageSize

integer

Jumlah entri per halaman.

50

TotalCount

integer

Jumlah total aturan penskalaan.

1

ScalingRules

object

ScalingRule

array<object>

Kumpulan informasi aturan penskalaan.

array<object>

Kumpulan informasi aturan penskalaan.

MetricName

string

The predefined metric. This parameter is applicable to target tracking scaling rules and predictive scaling rules.

Valid values for target tracking scaling rules:

  • CpuUtilization: the average CPU utilization.

  • ClassicInternetRx: the average inbound traffic over the public network for the classic network.

  • ClassicInternetTx: the average outbound traffic over the public network for the classic network.

  • VpcInternetRx: the average inbound traffic over the public network for VPCs.

  • VpcInternetTx: the average outbound traffic over the public network for VPCs.

  • IntranetRx: the average inbound traffic over the internal network.

  • IntranetTx: the average outbound traffic over the internal network.

Valid values for predictive scaling rules:

  • 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 or removes a specified number of ECS instances.

  • PercentChangeInCapacity: adds or removes a specified percentage of ECS instances.

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

QuantityChangeInCapacity

InitialMaxSize

integer

The maximum number of instances in the scaling group. This parameter is used in combination with PredictiveValueBehavior.

100

EstimatedInstanceWarmup

integer

The warm-up period of a newly created instance. During the warm-up period, the launched instance does not contribute to the monitoring metrics of the scaling group.

300

ScaleOutEvaluationCount

integer

After a target tracking scaling rule is created, an event-triggered task is automatically created through automatic creation. This parameter specifies the number of consecutive times that the conditional threshold must be met before the corresponding scale-out event-triggered node triggers an alert.

3

PredictiveScalingMode

string

The mode of the predictive scaling rule. Valid values:

  • PredictAndScale: generates prediction results and creates prediction tasks.

  • PredictOnly: generates prediction results but does not create prediction tasks.

PredictAndScale

MinAdjustmentMagnitude

integer

The minimum number of instances to adjust in the scaling rule. This parameter takes effect only when the scaling rule type is SimpleScalingRule or StepScalingRule and AdjustmentType is set to PercentChangeInCapacity.

1

ScalingRuleAri

string

The unique identifier of the scaling rule.

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

PredictiveTaskBufferTime

integer

The prediction nodes through automatic creation by the predictive scaling rule are executed on the hour by default. You can configure the settings for a buffer time to execute prediction nodes ahead of schedule to prepare resources in advance. Valid values: 0 to 60. Unit: minutes.

30

MinSize

integer

The minimum number of instances 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: the initial maximum value overrides the predicted value. If the predicted value is greater than the initial maximum value, the maximum value of the prediction task is set to the initial maximum value.

  • PredictiveValueOverrideMax: the predicted value overrides the initial maximum value. If the predicted value is greater than the initial maximum value, the maximum value of the prediction task is set to the predicted value.

  • PredictiveValueOverrideMaxWithBuffer: the predicted value is increased by a specified ratio. The predicted value is increased by the ratio specified by PredictiveValueBuffer. If the increased value is greater than the initial maximum value, the increased value is used.

MaxOverridePredictiveValue

TargetValue

number

The target value. When the scaling rule is a target tracking scaling rule or a predictive scaling rule, the scaling rule adds or removes instances to keep the metric close to the target value.

0.125

Cooldown

integer

The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Valid values: 0 to 86400. Unit: seconds.

20

MaxSize

integer

The maximum number of instances in the scaling group.

2

PredictiveValueBuffer

integer

This parameter takes effect when PredictiveValueBehavior is set to PredictiveValueOverrideMaxWithBuffer. The predicted value is increased by the specified ratio. If the increased value is greater than the initial maximum value, the increased value is used. Valid values: 0 to 100.

50

ScalingRuleType

string

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

AdjustmentValue

integer

The adjustment value of the scaling rule.

1

ScaleInEvaluationCount

integer

After a target tracking scaling rule is created, an event-triggered task is automatically created through automatic creation. This parameter specifies the number of consecutive times that the conditional threshold must be met before the corresponding scale-in event-triggered node triggers an alert.

15

DisableScaleIn

boolean

Indicates whether scale-in is disabled. This parameter is applicable only to target tracking scaling rules. Valid values:

  • true: Scale-in is disabled.

  • false: Scale-in is allowed.

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 CloudMonitor event-triggered tasks associated with the scaling rule. Event-triggered tasks are returned only when the ShowAlarmRules parameter is set to true. Otherwise, an empty list is returned.

array<object>

The CloudMonitor event-triggered tasks associated with the scaling rule. Event-triggered tasks 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 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 for the event-triggered task associated with the scaling rule. The comparison operator indicates the relationship in which the statistical value and the threshold can satisfy the condition. Valid values:

  • The statistical value is greater than or equal to the threshold. Value: >=.

  • The statistical value is less than or equal to the threshold. Value: <=.

  • The statistical value is greater than the threshold. Value: >.

  • The statistical value is less than the threshold. Value: <.

>=

MetricName

string

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

CpuUtilization

EvaluationCount

integer

The number of consecutive times that the threshold expression must be met before the event-triggered task associated with the scaling rule enters the alert state.

3

AlarmTaskName

string

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

alarmtask****

MetricType

string

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

  • system: system monitoring event-triggered task.

  • custom: custom monitoring event-triggered task.

system

Threshold

number

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

50

Statistics

string

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

  • Average: the average value.

  • Maximum: the maximum value.

  • Minimum: the minimum value.

Average

Dimensions

object

Dimension

array<object>

The dimension information of the event-triggered task 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 associated with the metric. Valid values:

  • scaling_group: the scaling group ID.

  • userId: the user account ID.

scaling_group

DimensionValue

string

The dimension value of the event-triggered task associated with the metric.

asg-bp18p2yfxow2dloq****

Period

integer

The statistical period for monitoring data in the target tracking scaling rule.

60

StepAdjustments

object

StepAdjustment

array<object>

The step adjustments of the step scaling rule.

object

The step adjustments of the step scaling rule.

MetricIntervalUpperBound

number

The upper bound of the step adjustment. Valid values: -9.999999E18 to 9.999999E18.

5.0

ScalingAdjustment

integer

The number of instances to scale for the step adjustment.

1

MetricIntervalLowerBound

number

The lower bound of the step adjustment. Valid values: -9.999999E18 to 9.999999E18.

1.0

AlarmDimensions

object

AlarmDimension

array<object>

The dimension information associated with the metric. This parameter is applicable to target tracking scaling rules. Set this parameter when the metric requires additional dimension information, such as the rulePool dimension for the LoadBalancerRealServerAverageQps metric.

object

The dimension information associated with the metric. This parameter is applicable to target tracking scaling rules. Set this parameter when the metric requires additional dimension information, such as the rulePool dimension for the LoadBalancerRealServerAverageQps metric.

DimensionKey

string

The dimension key associated with the metric.

rulePool

DimensionValue

string

The dimension value associated with the metric.

sgp-l1cbirz451yxu2****

MetricType

string

The type of the 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 monitoring metrics repository.

To manage monitoring metrics repositories, see Manage monitoring metrics repositories.

aliyun-test

HybridMetrics

object

HybridMetric

array<object>

The Hybrid Cloud Monitoring monitoring metrics settings. For more information, see Use formula-based custom target tracking scaling rules.

array<object>

Id

string

The reference ID of the metric in the formula expression.

a

Expression

string

The formula expression for multiple Hybrid Cloud Monitoring metrics. The calculation result of the expression is used to trigger scaling. The expression must comply with the Reverse Polish Notation (RPN) specification and supports only the + - * / operators.

(a+b)/2

MetricName

string

The name of the monitoring metric in the Hybrid Cloud Monitoring monitoring metrics repository.

AliyunSmq_NumberOfMessagesVisible

Statistic

string

The statistical method of the metric. Valid values:

  • Average: the average of all data points within the specified interval.

  • Minimum: the minimum of all data points within the specified interval.

  • Maximum: the maximum of all data points within the specified interval.

Average

Dimensions

object

Dimension

array<object>

The metric dimension. Specifies the resource to be monitored by the metric.

object

DimensionKey

string

The dimension key of the metric.

queue

DimensionValue

string

The dimension value of the metric.

testQueue

Contoh

Respons sukses

JSONformat

{
  "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"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.