All Products
Search
Document Center

Serverless App Engine:DescribeApplicationScalingRules

Last Updated:Jun 11, 2026

Mendeskripsikan kebijakan Penyesuaian Skala Otomatis untuk aplikasi.

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

sae:DescribeApplicationScalingRules

get

*全部资源

*

None None

Sintaks permintaan

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

Parameter permintaan

Parameter

Type

Required

Description

Example

AppId

string

Yes

ID aplikasi.

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

Elemen respons

Element

Type

Description

Example

object

The returned information.

RequestId

string

The request ID.

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

TraceId

string

The trace ID used to query the details of a request.

0a98a02315955564772843261e****

Data

object

The returned data.

CurrentPage

integer

The current page number.

1

TotalSize

integer

The total number of auto scaling policies for the application.

3

PageSize

integer

The number of entries per page.

10

ApplicationScalingRules

array<object>

A list of auto scaling policies for the application.

array<object>

An auto scaling policy.

Timer

object

The scheduled scaling policy.

EndDate

string

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

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

  • If you specify a date for this parameter, such as 2021-04-25 for EndDate and 2021-03-25 for BeginDate, the policy is a short-term policy that is effective for one month.

2021-04-25

BeginDate

string

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

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

  • If you specify a date for this parameter, such as 2021-03-25 for BeginDate and 2021-04-25 for EndDate, the policy is a short-term policy that is effective for one month.

2021-03-25

Schedules

array<object>

The points in time when the 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.

3

MaxReplicas

integer

The maximum number of instances.

50

MinReplicas

integer

The minimum number of instances.

1

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 the week. You can select multiple days. The days are in the GMT+8 time zone. 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 the month. You can select multiple days. Valid values: 1 to 31. If a month does not have a 31st day, the policy is not executed on that day.

* * *

TimeZone

string

UpdateTime

integer

The time when the Auto Scaling policy was last updated. Unit: milliseconds.

1616642248938

AppId

string

The application ID.

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

CreateTime

integer

The time when the Auto Scaling policy was created. Unit: milliseconds.

1616642248938

LastDisableTime

integer

The time when the Auto Scaling 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 list of metric-based scaling policies.

object

The metric data.

MetricTargetAverageUtilization

integer

The target value of the metric.

  • The target CPU usage. Unit: percent.

  • The target memory usage. Unit: percent.

  • Queries per second (QPS). Unit: seconds.

  • The response time. Unit: milliseconds.

  • The average number of active TCP connections. Unit: connections per second.

  • The QPS of the public-facing SLB instance. Unit: seconds.

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

  • The QPS of the private SLB instance. Unit: seconds.

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

20

MetricType

string

The trigger condition of the metric. Valid values:

  • CPU: CPU usage.

  • MEMORY: memory usage.

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

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

  • tcpActiveConn: The average number of active TCP connections of a single instance within 30 seconds.

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

  • SLB_RT: The average RT of a public-facing SLB instance within 15 seconds.

  • INTRANET_SLB_QPS: The average QPS of a single instance for a private SLB instance within 15 seconds.

  • INTRANET_SLB_RT: The average RT of a private SLB instance within 15 seconds.

CPU

SlbProject

string

The project of the SLB access log.

test

SlbLogstore

string

The Logstore of the SLB access log.

test

Vport

string

The port of the SLB instance.

80

SlbId

string

The ID of the SLB instance.

lb-xxx

PrometheusMetrics

array<object>

object

PrometheusQuery

string

TargetMetricValue

string

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>

The list of current metrics for scaling.

object

The metric data.

Type

string

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

  • Resource: The value of a cpu or memory metric.

  • Pods: The value of a tcpActiveConn metric.

  • External: The value of an arms or slb metric.

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: The QPS of a Java application.

  • arms_incall_rt: The RT of a Java application.

  • 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 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: The QPS of a Java application.

  • arms_incall_rt: The RT of a Java application.

  • 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

MaxReplicas

integer

The maximum number of instances.

3

MinReplicas

integer

The minimum number of instances.

1

ScaleUpRules

object

The rules for scaling out the application.

Step

integer

The scaling step size for scale-out events. The maximum number of instances that can be added in a unit of time.

100

StabilizationWindowSeconds

integer

The cooldown time for scale-out events. Valid values: 0 to 3600. Unit: seconds. The default value is 0.

300

Disabled

boolean

Indicates whether scale-in is disabled. Valid values:

  • true: enabled.

  • false: disabled.

Catatan

If this parameter is set to true, the number of application instances is never scaled in. This prevents business risks that are caused by unexpected scale-in activities during peak hours. The default value is false.

false

ScaleDownRules

object

The rules for scaling in the application.

Step

integer

The scaling step size for scale-in events. The maximum number of instances that can be removed in a unit of time.

100

StabilizationWindowSeconds

integer

The cooldown time for scale-in events. Valid values: 0 to 3600. Unit: seconds. The default value is 0.

300

Disabled

boolean

Indicates whether scale-in is disabled. Valid values:

  • true: enabled.

  • false: disabled.

Catatan

If this parameter is set to true, the number of application instances is never scaled in. This prevents business risks that are caused by unexpected scale-in activities during peak hours. The default value is false.

false

MetricSource

string

PrometheusUrl

string

PrometheusToken

string

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, the minimum number of available instances is determined by the system. The value is the result of the existing instances multiplied by 25%. For example, if you have 5 instances, the minimum number of available instances is 2, which is the result of 5 × 25% = 1.25 rounded up to the nearest integer.

Catatan

We recommend that you set the minimum number of available instances to a value greater than or equal to 1 to ensure that your business is not interrupted during a rolling deployment.

1

MinReadyInstanceRatio

integer

The percentage of the minimum number of available instances. Valid values:

  • -1: The initial value. This value indicates that the percentage is not used.

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

Catatan

If you specify both MinReadyInstanceRatio and MinReadyInstances, and the value of MinReadyInstanceRatio is not -1, the value of MinReadyInstanceRatio prevails. For example, if you set MinReadyInstances to 5 and MinReadyInstanceRatio to 50, the minimum number of available instances is calculated based on the value 50.

-1

Message

string

The response message. Valid values:

  • Returns success if the request is successful.

  • Returns an error message if the request fails.

success

ErrorCode

string

The error code. This parameter is returned only when the request fails.

  • For more information, see the Error codes section of this topic.

Code

string

The HTTP status code. Valid values:

  • 2xx: The request was successful.

  • 3xx: The request was redirected.

  • 4xx: The request was invalid.

  • 5xx: A server error occurred.

200

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The call was successful.

  • false: The call failed.

true

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.