Todos os produtos
Search
Central de documentação

Auto Scaling:DescribeScalingRules

Última atualização: Sep 10, 2026

Consulta as regras de escalabilidade em um grupo de escalabilidade e retorna informações sobre as regras de escalabilidade.

Experimente agora

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

A tabela abaixo descreve a autorização necessária para chamar esta API. Você pode defini-la em uma política do Resource Access Management (RAM). As colunas da tabela estão detalhadas abaixo:

  • Ação: As ações que podem ser usadas no elemento Action das instruções de política de permissão do RAM para conceder permissões para executar a operação.

  • API: A API que você pode chamar para executar a ação.

  • Nível de acesso: O nível de acesso predefinido concedido para cada API. Valores válidos: create, list, get, update e delete.

  • Tipo de recurso: O tipo de recurso que suporta autorização para executar a ação. Indica se a ação suporta permissão em nível de recurso. O recurso especificado deve ser compatível com a ação. Caso contrário, a política será ineficaz.

    • Para APIs com permissões em nível de recurso, os tipos de recursos obrigatórios são marcados com um asterisco (*). Especifique o Nome de Recurso Alibaba Cloud (ARN) correspondente no elemento Resource da política.

    • Para APIs sem permissões em nível de recurso, é exibido como Todos os Recursos. Use um asterisco (*) no elemento Resource da política.

  • Chave de condição: As chaves de condição definidas pelo serviço. A chave permite controle granular, aplicando-se somente a ações ou a ações associadas a recursos específicos. Além das chaves de condição específicas do serviço, o Alibaba Cloud fornece um conjunto de chaves de condição comuns aplicáveis a todos os serviços compatíveis com RAM.

  • Ação dependente: As ações dependentes necessárias para executar a ação. Para concluir a ação, o usuário RAM ou a função RAM deve ter permissões para executar todas as ações dependentes.

Ação

Nível de acesso

Tipo de recurso

Chave de condição

Ação dependente

ess:DescribeScalingRules

get

*ScalingGroup

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

Nenhuma Nenhuma

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

RegionId

string

Sim

O ID da região do grupo de escalabilidade ao qual as regras de escalabilidade pertencem.

cn-qingdao

PageNumber

integer

Não

O número da página da lista de regras de escalabilidade. Valor mínimo: 1.

Valor padrão: 1.

1

PageSize

integer

Não

O número de entradas por página para consultas paginadas. Configurações: valor máximo: 50.

Valor padrão: 10.

50

ScalingGroupId

string

Não

O ID do grupo de escalabilidade.

asg-bp1ffogfdauy0jw0****

ScalingRuleType

string

Não

O tipo da regra de escalabilidade. Valores válidos:

  • SimpleScalingRule: escalabilidade simples. Ajusta o número de instâncias ECS com base no método de ajuste (AdjustmentType) e no valor de ajuste (AdjustmentValue).

  • TargetTrackingScalingRule: regra de escalabilidade por rastreamento de destino. Calcula dinamicamente o número de instâncias ECS para escalar horizontalmente ou reduzir com base na métrica de monitoramento predefinida (MetricName) e tenta manter o valor da métrica de monitoramento próximo ao valor de destino (TargetValue).

  • StepScalingRule: regra de escalabilidade por etapas. Fornece extensão baseada em etapas com base em limites e valores de métricas.

  • PredictiveScalingRule: regra de escalabilidade preditiva. Usa aprendizado de máquina para analisar dados históricos de monitoramento do grupo de escalabilidade, prever valores futuros de métricas de monitoramento e oferece suporte à criação automática de nós agendados para configurar os limites do grupo de escalabilidade.

SimpleScalingRule

ShowAlarmRules

boolean

Não

Especifica se as tarefas acionadas por eventos do CloudMonitor associadas às regras de escalabilidade devem ser retornadas. Valores válidos:

  • true: retorna as tarefas acionadas por eventos do CloudMonitor associadas às regras de escalabilidade.

  • false: não retorna as tarefas acionadas por eventos do CloudMonitor associadas às regras de escalabilidade.

Valor padrão: false.

false

ScalingRuleId

array

Não

O ID da regra de escalabilidade N que você deseja consultar. Valores válidos de N: 1 a 10.

asr-bp1dvirgwkoowxk7****

string

Não

O ID da regra de escalabilidade N que você deseja consultar. Valores válidos de N: 1 a 10.

asr-bp1dvirgwkoowxk7****

ScalingRuleName

array

Não

O nome da regra de escalabilidade N que você deseja consultar. Valores válidos de N: 1 a 10.

scalingrule****

string

Não

O nome da regra de escalabilidade N que você deseja consultar. Valores válidos de N: 1 a 10.

scalingrule****

ScalingRuleAri

array

Não

O identificador exclusivo da regra de escalabilidade N que você deseja consultar. Valores válidos de N: 1 a 10.

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

string

Não

O identificador exclusivo da regra de escalabilidade N que você deseja consultar. Valores válidos de N: 1 a 10.

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

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

RequestId

string

O ID da solicitação.

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

PageNumber

integer

O número da página atual.

1

PageSize

integer

O número de entradas por página.

50

TotalCount

integer

O número total de regras de escalabilidade.

1

ScalingRules

object

ScalingRule

array<object>

A coleção de informações das regras de escalabilidade.

array<object>

A coleção de informações das regras de escalabilidade.

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

Exemplos

Resposta de sucesso

JSON formato

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

Códigos de erro

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.