Todos os produtos
Search
Central de documentação

Serverless App Engine:DescribeApplicationScalingRule

Última atualização: Jun 28, 2026

Descreve uma única política de auto scaling para uma aplicação.

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

sae:DescribeApplicationScalingRule

get

*All Resource

*

Nenhuma Nenhuma

Sintaxe da solicitação

GET /pop/v1/sam/scale/applicationScalingRule HTTP/1.1

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

AppId

string

Sim

O ID da aplicação.

a0d2e04c-159d-40a8-b240-d2f2c263****

ScalingRuleName

string

Sim

O nome da política de auto scaling.

test

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

As informações retornadas.

RequestId

string

O ID da solicitação.

73404D3D-EE4F-4CB2-B197-5C46F6A1****

TraceId

string

O ID de rastreamento. Use este ID para consultar os detalhes de uma solicitação.

0b57ff7e16243300839193068e****

Data

object

Os dados retornados.

Timer

object

A política de escalonamento agendado.

EndDate

string

The end date of a short-term scheduled scaling policy. The following list describes the valid values:

  • If you leave both BeginDate and EndDate empty, the policy is a long-term policy. This is the default value.

  • If you specify a date, for example, you set BeginDate to 2021-03-25 and EndDate to 2021-04-25, the policy is effective for one month.

2021-04-25

BeginDate

string

The start date of a short-term scheduled scaling policy. The following list describes the valid values:

  • If you leave both BeginDate and EndDate empty, the policy is a long-term policy. This is the default value.

  • If you specify a date, for example, you set BeginDate to 2021-03-25 and EndDate to 2021-04-25, the policy is effective for one month.

2021-03-25

Schedules

array<object>

The points in time when the auto scaling policy is triggered within a day.

object

The data of a point in time.

AtTime

string

The point in time. Format: HH:mm.

08:00

TargetReplicas

integer

The target number of instances.

2

MinReplicas

integer

The minimum number of instances.

1

MaxReplicas

integer

The maximum number of instances.

10

Period

string

The period in which the scheduled scaling policy is executed. Valid values:

  • * * *: The policy is executed at a specified time every day.

  • * * Fri,Mon: The policy is executed at a specified time on one or more days of a week. You can select multiple days. The time is in GMT+8. Valid values:

    • Sun: Sunday

    • Mon: Monday

    • Tue: Tuesday

    • Wed: Wednesday

    • Thu: Thursday

    • Fri: Friday

    • Sat: Saturday

  • 1,2,3,28,31 * *: The policy is executed at a specified time on one or more days of a month. You can select multiple days. The value can be an integer from 1 to 31. If a month does not have a 31st day, the policy is not executed on that day.

* * *

UpdateTime

integer

A hora em que a política de auto scaling foi atualizada. Unidade: milissegundos.

1624330075827

AppId

string

O ID da aplicação.

a0d2e04c-159d-40a8-b240-d2f2c263****

CreateTime

integer

A hora em que a política de auto scaling foi criada. Unidade: milissegundos.

1624329843790

LastDisableTime

integer

A hora em que a política de auto scaling foi desativada pela última vez.

1641882854484

ScaleRuleEnabled

boolean

Indica se a política de auto scaling está ativada. Valores válidos:

  • true: A política está ativada.

  • false: A política está desativada.

true

ScaleRuleType

string

O tipo da política de auto scaling. Valores válidos:

  • timing: escalonamento agendado.

  • metric: escalonamento baseado em métricas.

  • mix: escalonamento híbrido.

timing

Metric

object

A política de escalonamento baseado em métricas.

Metrics

array<object>

The list of metric-based scaling policies.

object

The metric data.

MetricTargetAverageUtilization

integer

The target value of the metric.

  • The target CPU utilization. Unit: percent.

  • The target memory usage. Unit: percent.

  • The number of queries per second (QPS).

  • The response time. Unit: milliseconds.

  • The average number of active TCP connections per second.

  • The QPS of a public-facing SLB instance.

  • The response time of a public-facing SLB instance. Unit: milliseconds.

  • The QPS of a private SLB instance.

  • The response time of a private SLB instance. Unit: milliseconds.

20

MetricType

string

The metric that is used to trigger the auto scaling policy. Valid values:

  • CPU: CPU utilization.

  • MEMORY: memory usage.

  • QPS: the average QPS of a single instance of a Java application in one minute.

  • RT: the average response time (RT) of all service interfaces of a Java application in one minute.

  • tcpActiveConn: the average number of active TCP connections of a single instance in 30 seconds.

  • SLB_QPS: the average QPS of a single instance for a public-facing SLB instance in 15 seconds.

  • SLB_RT: the average RT of a public-facing SLB instance in 15 seconds.

  • INTRANET_SLB_QPS: the average QPS of a single instance for a private SLB instance in 15 seconds.

  • INTRANET_SLB_RT: the average RT of a private SLB instance in 15 seconds.

CPU

SlbProject

string

The SLB access log Project.

test

SlbLogstore

string

The SLB access log Logstore.

test

Vport

string

The port of the SLB instance.

80

SlbId

string

The ID of the SLB instance.

lb-xxx

MetricsStatus

object

The status of the metric-based scaling policy.

DesiredReplicas

integer

The target number of instances.

2

NextScaleTimePeriod

integer

The period of the next metric-based scaling.

3

CurrentReplicas

integer

The current number of instances.

2

LastScaleTime

string

The time of the last scaling activity.

2022-01-11T08:14:32Z

CurrentMetrics

array<object>

The data of the current metric-based scaling.

object

The metric data.

Type

string

The type of the metric. This parameter is associated with the monitoring metric.

  • Resource: the metric value of cpu or memory.

  • Pods: the metric value of tcpActiveConn.

  • External: the metric value of arms or slb.

Resource

CurrentValue

integer

The current value.

0

Name

string

The name of the metric.

  • cpu: CPU utilization.

  • memory: memory usage.

  • arms_incall_qps: the average QPS of a single instance of a Java application in one minute.

  • arms_incall_rt: the average RT of all service interfaces of a Java application in one minute.

  • tcpActiveConn: the number of active TCP connections.

  • slb_incall_qps: the QPS of a public-facing SLB instance.

  • slb_incall_rt: the RT of a public-facing SLB instance.

  • intranet_slb_incall_qps: the QPS of a private SLB instance.

  • intranet_slb_incall_rt: the RT of a private SLB instance.

cpu

NextScaleMetrics

array<object>

The list of metrics for the next scaling activity.

object

The metric data.

NextScaleOutAverageUtilization

integer

The metric threshold for the next scale-out. The value is a percentage.

21

NextScaleInAverageUtilization

integer

The metric threshold for the next scale-in. The value is a percentage.

10

Name

string

The name of the metric.

  • cpu: CPU utilization.

  • memory: memory usage.

  • arms_incall_qps: the average QPS of a single instance of a Java application in one minute.

  • arms_incall_rt: the average RT of all service interfaces of a Java application in one minute.

  • tcpActiveConn: the number of active TCP connections.

  • slb_incall_qps: the QPS of a public-facing SLB instance.

  • slb_incall_rt: the RT of a public-facing SLB instance.

  • intranet_slb_incall_qps: the QPS of a private SLB instance.

  • intranet_slb_incall_rt: the RT of a private SLB instance.

cpu

MaxReplicas

integer

The maximum number of instances.

3

MinReplicas

integer

The minimum number of instances.

1

ScaleUpRules

object

The scale-out rules.

Step

integer

The scaling step size for scale-outs. The maximum number of instances that can be added at a time.

100

StabilizationWindowSeconds

integer

The cooldown period for scale-outs. The value can be an integer from 0 to 3600. Unit: seconds. Default value: 0.

300

Disabled

boolean

Indicates whether scale-in is disabled. Valid values:

  • true: enabled.

  • false: disabled.

Nota

If you enable this feature, the application is never scaled in. This prevents business risks that are caused by scale-ins during peak hours. By default, this feature is disabled.

false

ScaleDownRules

object

The scale-in rules.

Step

integer

The scaling step size for scale-ins. The maximum number of instances that can be removed at a time.

100

StabilizationWindowSeconds

integer

The cooldown period for scale-ins. The value can be an integer from 0 to 3600. Unit: seconds. Default value: 0.

300

Disabled

boolean

Indicates whether scale-in is disabled. Valid values:

  • true: enabled.

  • false: disabled.

Nota

If you enable this feature, the application is never scaled in. This prevents business risks that are caused by scale-ins during peak hours. By default, this feature is disabled.

false

ScaleRuleName

string

O nome da política de auto scaling.

test

MinReadyInstances

integer

O número mínimo de instâncias prontas. Valores válidos:

  • Se você definir este parâmetro como 0, a aplicação será interrompida durante uma atualização.

  • Se você definir este parâmetro como -1, o sistema usará um valor recomendado para o número mínimo de instâncias prontas. O valor é 25% do número atual de instâncias. Por exemplo, se o número atual de instâncias for 5, o número mínimo de instâncias prontas será 2 após 5 × 25% = 1,25 ser arredondado para cima.

Nota

Defina o número mínimo de instâncias prontas com um valor maior ou igual a 1 para cada implantação rolling para garantir a continuidade dos negócios.

1

MinReadyInstanceRatio

integer

A porcentagem do número mínimo de instâncias prontas. Valores válidos:

  • -1: um valor inicial, que indica que uma porcentagem não é usada.

  • 0 a 100: uma porcentagem que é arredondada para cima. Por exemplo, se você definir este parâmetro como 50% e o número atual de instâncias for 5, o número mínimo de instâncias prontas será 3.

Nota

Se você especificar MinReadyInstances e MinReadyInstanceRatio, e o valor de MinReadyInstanceRatio não for -1, o valor de MinReadyInstanceRatio prevalecerá. Por exemplo, se MinReadyInstances estiver definido como 5 e MinReadyInstanceRatio estiver definido como 50, o valor 50 será usado para calcular o número mínimo de instâncias prontas.

-1

Message

string

As informações adicionais. Valores válidos:

  • Se a solicitação for bem-sucedida, success será retornado.

  • Se a solicitação falhar, um código de erro específico será retornado.

success

ErrorCode

string

O código de erro. Valores válidos:

  • Se a solicitação for bem-sucedida, o campo ErrorCode não será retornado.

  • Se a solicitação falhar, o campo ErrorCode será retornado. Para mais informações, consulte a seção Códigos de erro neste tópico.

Code

string

O código de status HTTP ou um código de erro POP. Valores válidos:

  • 2xx: A operação foi bem-sucedida.

  • 3xx: Um redirecionamento é necessário.

  • 4xx: Ocorreu um erro de solicitação.

  • 5xx: Ocorreu um erro de servidor.

200

Success

boolean

Indica se a instância da aplicação foi reiniciada com sucesso.

  • true: A reinicialização foi bem-sucedida.

  • false: A reinicialização falhou.

true

Exemplos

Resposta de sucesso

JSON formato

{
  "RequestId": "73404D3D-EE4F-4CB2-B197-5C46F6A1****",
  "TraceId": "0b57ff7e16243300839193068e****",
  "Data": {
    "Timer": {
      "EndDate": "2021-04-25",
      "BeginDate": "2021-03-25",
      "Schedules": [
        {
          "AtTime": "08:00",
          "TargetReplicas": 2,
          "MinReplicas": 1,
          "MaxReplicas": 10
        }
      ],
      "Period": "* * *"
    },
    "UpdateTime": 1624330075827,
    "AppId": "a0d2e04c-159d-40a8-b240-d2f2c263****",
    "CreateTime": 1624329843790,
    "LastDisableTime": 1641882854484,
    "ScaleRuleEnabled": true,
    "ScaleRuleType": "timing",
    "Metric": {
      "Metrics": [
        {
          "MetricTargetAverageUtilization": 20,
          "MetricType": "CPU",
          "SlbProject": "test",
          "SlbLogstore": "test",
          "Vport": "80",
          "SlbId": "lb-xxx"
        }
      ],
      "MetricsStatus": {
        "DesiredReplicas": 2,
        "NextScaleTimePeriod": 3,
        "CurrentReplicas": 2,
        "LastScaleTime": "2022-01-11T08:14:32Z",
        "CurrentMetrics": [
          {
            "Type": "Resource",
            "CurrentValue": 0,
            "Name": "cpu"
          }
        ],
        "NextScaleMetrics": [
          {
            "NextScaleOutAverageUtilization": 21,
            "NextScaleInAverageUtilization": 10,
            "Name": "cpu"
          }
        ]
      },
      "MaxReplicas": 3,
      "MinReplicas": 1,
      "ScaleUpRules": {
        "Step": 100,
        "StabilizationWindowSeconds": 300,
        "Disabled": false
      },
      "ScaleDownRules": {
        "Step": 100,
        "StabilizationWindowSeconds": 300,
        "Disabled": false
      }
    },
    "ScaleRuleName": "test",
    "MinReadyInstances": 1,
    "MinReadyInstanceRatio": -1
  },
  "Message": "success",
  "ErrorCode": "",
  "Code": "200",
  "Success": true
}

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.