Tous les produits
Search
Centre de documentation

:DescribeApplicationScalingRules

Dernière mise à jour :Aug 07, 2026

Décrit les stratégies de mise à l'échelle automatique d'une application.

Testez maintenant

Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.

Test

Autorisation RAM

Le tableau ci-dessous décrit les autorisations nécessaires pour appeler cette API. Vous pouvez les définir dans une politique Resource Access Management (RAM). Les colonnes du tableau sont détaillées ci-dessous :

  • Action : les actions peuvent être utilisées dans l'élément Action des instructions de politique de permissions RAM pour accorder les autorisations nécessaires à l'exécution de l'opération.

  • API : l'API que vous pouvez appeler pour exécuter l'action.

  • Niveau d'accès : le niveau d'accès prédéfini accordé pour chaque API. Valeurs valides : create, list, get, update et delete.

  • Type de ressource : le type de ressource qui prend en charge l'autorisation pour exécuter l'action. Il indique si l'action prend en charge les permissions au niveau de la ressource. La ressource spécifiée doit être compatible avec l'action. Sinon, la politique sera inefficace.

    • Pour les API avec permissions au niveau de la ressource, les types de ressource requis sont marqués d'un astérisque (*). Spécifiez l'Alibaba Cloud Resource Name (ARN) correspondant dans l'élément Resource de la politique.

    • Pour les API sans permissions au niveau de la ressource, la valeur All Resources est affichée. Utilisez un astérisque (*) dans l'élément Resource de la politique.

  • Clé de condition : les clés de condition définies par le service. La clé permet un contrôle granulaire, applicable aux actions seules ou aux actions associées à des ressources spécifiques. En plus des clés de condition propres au service, Alibaba Cloud fournit un ensemble de clés de condition communes applicables à tous les services pris en charge par RAM.

  • Action dépendante : les actions dépendantes requises pour exécuter l'action. Pour mener à bien l'opération, l'utilisateur RAM ou le rôle RAM doit disposer des permissions pour toutes les actions dépendantes.

sae:DescribeApplicationScalingRules

get

*All Resource

*

Aucune Aucune

Syntaxe de la requête

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

Paramètres de requête

Paramètre

Type

Requis

Description

Exemple

AppId

string

Oui

L'identifiant de l'application.

7171a6ca-d1cd-4928-8642-7d5cfe69****

Éléments de réponse

Élément

Type

Description

Exemple

object

Les informations renvoyées.

RequestId

string

L'identifiant de la requête.

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

TraceId

string

L'identifiant de trace utilisé pour consulter les détails d'une requête.

0a98a02315955564772843261e****

Data

object

Les données renvoyées.

CurrentPage

integer

Le numéro de la page actuelle.

1

TotalSize

integer

Le nombre total de stratégies de mise à l'échelle automatique pour l'application.

3

PageSize

integer

Le nombre d'entrées par page.

10

ApplicationScalingRules

array<object>

Une liste des stratégies de mise à l'échelle automatique pour l'application.

array<object>

Une stratégie de mise à l'échelle automatique.

Timer

object

The scheduled scaling policy.

EndDate

string

The end date of the short-term scheduled scaling policy. The following rules apply:

  • If BeginDate and EndDate are not specified, the policy is long-term by default.

  • If you specify a BeginDate and an EndDate, the policy is short-term and applies only within that date range.

2021-04-25

BeginDate

string

The start date of the short-term scheduled scaling policy. The following rules apply:

  • If BeginDate and EndDate are not specified, the policy is long-term by default.

  • If you specify a BeginDate and an EndDate, the policy is short-term and applies only within that date range.

2021-03-25

Schedules

array<object>

The daily trigger schedule for the policy.

object

A specific trigger time and its target number of instances.

AtTime

string

The trigger time in HH:mm format.

08:00

TargetReplicas

integer

The target number of instances.

3

MaxReplicas

integer

The maximum number of instances.

50

MinReplicas

integer

The minimum number of instances.

1

Period

string

The days on which the scheduled scaling policy runs. Valid values:

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

  • * * Fri,Mon: Executes the policy on specified days of the week. The time zone is GMT+8. Valid days are listed below:

    • Sun: Sunday

    • Mon: Monday

    • Tue: Tuesday

    • Wed: Wednesday

    • Thu: Thursday

    • Fri: Friday

    • Sat: Saturday

  • 1,2,3,28,31 * *: Executes the policy on specified days of the month (1-31). If a specified day does not exist in a given month (e.g., the 31st), the policy does not run on that day.

* * *

TimeZone

string

The time zone.

UpdateTime

integer

The timestamp of the last policy update, in milliseconds.

1616642248938

AppId

string

The application ID.

7171a6ca-d1cd-4928-8642-7d5cfe69****

CreateTime

integer

The timestamp of the policy's creation, in milliseconds.

1616642248938

LastDisableTime

integer

The timestamp of when the policy was last disabled.

1641882854484

ScaleRuleEnabled

boolean

Indicates whether the auto scaling policy is enabled. Valid values:

  • true: The policy is enabled.

  • false: The policy is disabled.

true

ScaleRuleType

string

The type of the auto scaling policy. Valid values:

  • timing: A scheduled scaling policy.

  • metric: A metric-based scaling policy.

  • mix: A hybrid scaling policy.

timing

Metric

object

The metric-based scaling policy.

Metrics

array<object>

The metric-based conditions that trigger scaling.

object

A metric condition that can trigger a scaling event.

MetricTargetAverageUtilization

integer

The target value for the metric. The unit varies based on the value of MetricType.

  • Target CPU usage, in percent.

  • Target memory usage, in percent.

  • Target QPS, in queries per second.

  • Target response time, in milliseconds.

  • Target number of active TCP connections.

  • Target QPS of a public-facing SLB instance, in queries per second.

  • Target response time of a public-facing SLB instance, in milliseconds.

  • Target QPS of a private SLB instance, in queries per second.

  • Target response time of a private SLB instance, in milliseconds.

20

MetricType

string

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

  • CPU: CPU usage.

  • MEMORY: memory usage.

  • QPS: Average queries per second (QPS) per instance over a 1-minute period. This metric applies to Java applications only.

  • RT: Average response time of all service interfaces in a Java application over a 1-minute period.

  • tcpActiveConn: Average number of active TCP connections per instance over a 30-second period.

  • SLB_QPS: Average QPS per instance for a public-facing SLB instance over a 15-second period.

  • SLB_RT: Average response time of a public-facing SLB instance over a 15-second period.

  • INTRANET_SLB_QPS: Average QPS per instance for a private SLB instance over a 15-second period.

  • INTRANET_SLB_RT: Average response time of a private SLB instance over a 15-second period.

CPU

SlbProject

string

The project in Log Service that stores SLB access logs.

test

SlbLogstore

string

The Logstore in Log Service that stores SLB access logs.

test

Vport

string

The monitored port of the SLB instance.

80

SlbId

string

The ID of the SLB instance.

lb-xxx

PrometheusMetrics

array<object>

The Prometheus metrics.

object

PrometheusQuery

string

The Prometheus query.

TargetMetricValue

string

The target value for the Prometheus query that triggers a scaling event.

MetricsStatus

object

The status of the metric-based scaling policy.

DesiredReplicas

integer

The target number of instances.

2

NextScaleTimePeriod

integer

The next period for 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>

A list of the current metrics for scaling.

object

The metric data.

Type

string

The data type. This parameter is associated with the specified metric.

  • Resource: The metric value for cpu or memory.

  • Pods: The metric value for tcpActiveConn.

  • External: The metric value for arms or slb.

Resource

CurrentValue

integer

The current value.

0

Name

string

The name of the trigger condition.

  • cpu: CPU usage.

  • memory: memory usage.

  • arms_incall_qps_v2: QPS of a Java application.

  • arms_incall_rt: Response time of a Java application.

  • tcpActiveConn: The number of active TCP connections.

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

  • slb_incall_rt: Response time of a public-facing SLB instance.

  • intranet_slb_incall_qps: QPS of a private SLB instance.

  • intranet_slb_incall_rt: Response time of a private SLB instance.

cpu

NextScaleMetrics

array<object>

A list of metrics for the next scaling activity.

object

The metric data.

NextScaleOutAverageUtilization

integer

The metric value that triggers the next scale-out event. The value is a percentage.

21

NextScaleInAverageUtilization

integer

The metric value that triggers the next scale-in event. The value is a percentage.

10

Name

string

The name of the trigger condition.

  • cpu: CPU usage.

  • memory: memory usage.

  • arms_incall_qps_v2: QPS of a Java application.

  • arms_incall_rt: Response time of a Java application.

  • tcpActiveConn: The number of active TCP connections.

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

  • slb_incall_rt: Response time of a public-facing SLB instance.

  • intranet_slb_incall_qps: QPS of a private SLB instance.

  • intranet_slb_incall_rt: Response time of a private SLB instance.

cpu

MaxReplicas

integer

The maximum number of instances.

3

MinReplicas

integer

The minimum number of instances.

1

MaxReplicas

integer

The maximum number of instances.

3

MinReplicas

integer

The minimum number of instances.

1

ScaleUpRules

object

Configuration for scale-out events.

Step

integer

The number of instances to add in a single scale-out event.

100

StabilizationWindowSeconds

integer

The cooldown time for scale-out events, in seconds. During this period, no further scaling events are triggered. The value must be an integer from 0 to 3,600. The default value is 0.

300

Disabled

boolean

Specifies whether to disable scale-out. Valid values:

  • true: Disables scale-out.

  • false: Enables scale-out.

Remarque

If this parameter is set to true, application instances are never scaled out. This can be useful to freeze the application capacity during specific events. By default, this parameter is set to false.

false

ScaleDownRules

object

Configuration for scale-in events.

Step

integer

The number of instances to remove in a single scale-in event.

100

StabilizationWindowSeconds

integer

The cooldown time for scale-in events, in seconds. During this period, no further scaling events are triggered. The value must be an integer from 0 to 3,600. The default value is 0.

300

Disabled

boolean

Specifies whether to disable scale-in. Valid values:

  • true: Disables scale-in.

  • false: Enables scale-in.

Remarque

Setting this to true prevents the application from scaling in, which can be useful to avoid service disruptions from unexpected capacity reduction during peak hours. Default: false.

false

MetricSource

string

The source of the metrics.

PrometheusUrl

string

The endpoint of the Prometheus service.

PrometheusToken

string

The Prometheus token.

ScaleRuleName

string

The name of the auto scaling policy.

test

MinReadyInstances

integer

The minimum number of available instances. Valid values:

  • If you set this parameter to 0, the application may be interrupted during an upgrade.

  • If you set this parameter to -1, a recommended value is used, which is 25% of the current number of instances, rounded up to the nearest integer. For example, if an application has five instances, the minimum number of available instances is 2 (5 * 25% = 1.25, rounded up).

Remarque

To ensure business continuity during a rolling deployment, we recommend that you set this parameter to a value greater than or equal to 1.

1

MinReadyInstanceRatio

integer

The minimum number of available instances, specified as a percentage. Valid values:

  • -1: Indicates that this parameter is not used.

  • 0 to 100: a percentage that is rounded up to the nearest integer. For example, if you set this parameter to 50% and you have five instances, the minimum number of available instances is 3.

Remarque

If you specify both MinReadyInstances and MinReadyInstanceRatio, the value of MinReadyInstanceRatio takes precedence, unless it is set to -1.

-1

Message

string

Le message de réponse. Valeurs valides :

success

ErrorCode

string

Le code d'erreur. Ce paramètre n'est renvoyé que lorsque la requête échoue.

Code

string

Le code d'état HTTP. Valeurs valides :

200

Success

boolean

Indique si la requête a réussi. Valeurs valides :

true

Exemples

JSON format

{
  "RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "TraceId": "0a98a02315955564772843261e****",
  "Data": {
    "CurrentPage": 1,
    "TotalSize": 3,
    "PageSize": 10,
    "ApplicationScalingRules": [
      {
        "Timer": {
          "EndDate": "2021-04-25",
          "BeginDate": "2021-03-25",
          "Schedules": [
            {
              "AtTime": "08:00",
              "TargetReplicas": 3,
              "MaxReplicas": 50,
              "MinReplicas": 1
            }
          ],
          "Period": "* * *",
          "TimeZone": ""
        },
        "UpdateTime": 1616642248938,
        "AppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****",
        "CreateTime": 1616642248938,
        "LastDisableTime": 1641882854484,
        "ScaleRuleEnabled": true,
        "ScaleRuleType": "timing",
        "Metric": {
          "Metrics": [
            {
              "MetricTargetAverageUtilization": 20,
              "MetricType": "CPU",
              "SlbProject": "test",
              "SlbLogstore": "test",
              "Vport": "80",
              "SlbId": "lb-xxx"
            }
          ],
          "PrometheusMetrics": [
            {
              "PrometheusQuery": "",
              "TargetMetricValue": ""
            }
          ],
          "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
          },
          "MaxReplicas": 3,
          "MinReplicas": 1,
          "ScaleUpRules": {
            "Step": 100,
            "StabilizationWindowSeconds": 300,
            "Disabled": false
          },
          "ScaleDownRules": {
            "Step": 100,
            "StabilizationWindowSeconds": 300,
            "Disabled": false
          },
          "MetricSource": "",
          "PrometheusUrl": "",
          "PrometheusToken": ""
        },
        "ScaleRuleName": "test",
        "MinReadyInstances": 1,
        "MinReadyInstanceRatio": -1
      }
    ]
  },
  "Message": "success",
  "ErrorCode": "",
  "Code": "200",
  "Success": true
}

Codes d'erreur

Consultez Codes d'erreur pour la liste complète.

Notes de version

Consultez Notes de version pour la liste complète.