All Products
Search
Document Center

Auto Scaling:DescribeAlarms

Last Updated:Sep 10, 2026

Mengkueri informasi tentang tugas yang dipicu oleh peristiwa.

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:DescribeAlarms

get

*ScalingGroup

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

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID wilayah tempat tugas yang dipicu oleh peristiwa berada.

cn-qingdao

ScalingGroupId

string

No

ID grup penskalaan yang terkait dengan tugas yang dipicu oleh peristiwa.

asg-bp18p2yfxow2dloq****

AlarmTaskId

string

No

ID tugas yang dipicu oleh peristiwa.

asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****

State

string

No

Status tugas yang dipicu oleh peristiwa. Nilai yang valid:

  • ALARM: Kondisi peringatan terpenuhi.

  • OK: Kondisi peringatan tidak terpenuhi.

  • INSUFFICIENT_DATA: Data tidak cukup untuk menentukan apakah kondisi peringatan terpenuhi.

OK

IsEnable

boolean

No

Menentukan apakah tugas yang dipicu oleh peristiwa diaktifkan. Nilai yang valid:

  • true: diaktifkan.

  • false: dinonaktifkan.

true

MetricType

string

No

Jenis metrik pemantauan. Nilai yang valid:

  • system: menggunakan metrik sistem CloudMonitor.

  • custom: menggunakan metrik kustom yang dilaporkan ke CloudMonitor.

system

MetricName

string

No

Nama metrik pemantauan.

CpuUtilization

PageSize

integer

No

Jumlah entri per halaman. Nilai maksimum: 50.

Nilai default: 10.

10

PageNumber

integer

No

Nomor halaman daftar tugas yang dipicu oleh peristiwa. Nilai minimum: 1.

Nilai default: 1.

1

Elemen respons

Element

Type

Description

Example

object

Informasi tentang tugas yang dipicu oleh peristiwa.

PageSize

integer

Jumlah entri per halaman.

10

RequestId

string

ID permintaan.

871C7C53-34A4-45AA-8C14-4B72FA6A****

PageNumber

integer

Nomor halaman saat ini.

1

TotalCount

integer

Jumlah total tugas yang dipicu oleh peristiwa.

2

AlarmList

object

Alarm

array<object>

Daftar tugas yang dipicu oleh peristiwa.

array<object>

Daftar tugas yang dipicu oleh peristiwa.

AlarmTaskId

string

The ID of the event-triggered task.

asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****

MetricName

string

The name of the monitoring metric. Valid values:

  • CpuUtilization: (ECS) CPU utilization (%).

  • ConcurrentConnections: (ECS) number of concurrent connections to an ECS instance.

  • IntranetTx: (ECS) outbound traffic over the internal network (KB/min).

  • IntranetRx: (ECS) inbound traffic over the internal network (KB/min).

  • VpcInternetTx: (ECS) outbound traffic over the Internet (KB/min).

  • VpcInternetRx: (ECS) inbound traffic over the Internet (KB/min).

  • SystemDiskReadBps: (ECS) system cloud disk read BPS (bytes/s).

  • SystemDiskWriteBps: (ECS) system cloud disk write BPS (bytes/s).

  • SystemDiskReadOps: (ECS) system cloud disk read IOPS (operations/s).

  • SystemDiskWriteOps: (ECS) system cloud disk write IOPS (operations/s).

  • CpuUtilizationAgent: (Agent) CPU utilization (%).

  • GpuUtilizationAgent: (Agent) GPU utilization (%).

  • GpuMemoryFreeUtilizationAgent: (Agent) idle GPU memory (%).

  • GpuMemoryUtilizationAgent: (Agent) GPU memory usage (%).

  • MemoryUtilization: (Agent) memory usage (%).

  • LoadAverage: (Agent) average system load.

  • TcpConnection: (Agent) total number of TCP connections.

  • TcpConnection: (Agent) number of established TCP connections.

  • PackagesNetOut: (Agent) number of packets sent by the internal NIC (packets/s).

  • PackagesNetIn: (Agent) number of packets received by the internal NIC (packets/s).

  • PackagesNetOut: (Agent) number of packets sent by the public NIC (packets/s).

  • PackagesNetIn: (Agent) number of packets received by the public NIC (packets/s).

  • EciPodCpuUtilization: CPU utilization (%).

  • EciPodMemoryUtilization: memory usage (%).

  • LoadBalancerRealServerAverageQps: (ALB) average QPS per server in a server group (queries/s).

For more information, see System monitoring event-triggered tasks.

CpuUtilization

EvaluationCount

integer

The number of consecutive times that the threshold expression must be met before the scaling rule is triggered. For example, the average CPU utilization must be greater than or equal to 80% for three consecutive statistical periods.

3

State

string

The state of the event-triggered task. Valid values:

  • ALARM: The alert condition is met.

  • OK: The alert condition is not met.

  • INSUFFICIENT_DATA: Insufficient data to determine whether the alert condition is met.

ALARM

Period

integer

The statistical period for the monitoring metric data, in seconds. Valid values:

Catatan

Only ECS-type scaling groups support a 15-second statistical period.

300

ScalingGroupId

string

The ID of the scaling group associated with the event-triggered task.

asg-bp18p2yfxow2dloq****

ComparisonOperator

string

The comparison operator between the statistical value and the threshold of the monitoring metric. This operator specifies the condition under which the alert is triggered. 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: <.

>=

Effective

string

The effective period of the event-triggered task.

* * * * * ?

Description

string

The description of the event-triggered task.

Test alarm task.

MetricType

string

The type of the monitoring metric. Valid values:

  • system: uses CloudMonitor system metrics.

  • custom: uses custom metrics reported to CloudMonitor.

system

Name

string

The name of the event-triggered task.

TestAlarmTask

Threshold

number

The threshold of the monitoring metrics. The scaling rule is triggered when the threshold expression is met for the specified number of times.

80.0

Enable

boolean

Indicates whether the event-triggered task is enabled. Valid values:

  • true: enabled.

  • false: disabled.

true

Statistics

string

The method used to aggregate the monitoring metric data. Valid values:

  • Average: average value.

  • Minimum: minimum value.

  • Maximum: maximum value.

Average

Dimensions

object

Dimension

array<object>

The dimension information associated with the monitoring metric.

object

The dimension information associated with the monitoring metric.

DimensionKey

string

The key of the dimension information associated with the monitoring metric. Valid values:

  • user_id: the ID of your account.

  • scaling_group: the scaling group being monitored.

  • device: the type of the NIC device.

  • state: the state of the TCP connection.

device

DimensionValue

string

The value of the dimension information associated with the monitoring metric. The valid values depend on the dimension key.

  • user_id: automatically populated by the system.

  • scaling_group: automatically populated by the system.

  • Valid values of device:

    • eth0: For classic VPC-connected instances, eth0 represents the internal NIC. For VPC instances, only the eth0 NIC exists.

    • eth1: For classic VPC-connected instances, eth1 represents the public NIC.

  • Valid values of state:

    • TCP_TOTAL: the total number of TCP connections.

    • ESTABLISHED: the number of established TCP connections.

eth0

AlarmActions

object

AlarmAction

array

The list of unique identifiers of the scaling rules associated with the event-triggered task.

string

The list of unique identifiers of the scaling rules associated with the event-triggered task.

ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****

Expressions

object

Expression

array<object>

The information about multi-metric alert rules.

object

The information about multi-metric alert rules.

MetricName

string

The name of the monitoring metric in the multi-metric alert rule. Valid values:

  • CpuUtilization: (ECS) CPU utilization (%).

  • ConcurrentConnections: (ECS) number of concurrent connections to an ECS instance.

  • IntranetTx: (ECS) outbound traffic over the internal network (KB/min).

  • IntranetRx: (ECS) inbound traffic over the internal network (KB/min).

  • VpcInternetTx: (ECS) outbound traffic over the Internet (KB/min).

  • VpcInternetRx: (ECS) inbound traffic over the Internet (KB/min).

  • SystemDiskReadBps: (ECS) system cloud disk read BPS (bytes/s).

  • SystemDiskWriteBps: (ECS) system cloud disk write BPS (bytes/s).

  • SystemDiskReadOps: (ECS) system cloud disk read IOPS (operations/s).

  • SystemDiskWriteOps: (ECS) system cloud disk write IOPS (operations/s).

  • CpuUtilizationAgent: (Agent) CPU utilization (%).

  • GpuUtilizationAgent: (Agent) GPU utilization (%).

  • GpuMemoryFreeUtilizationAgent: (Agent) idle GPU memory (%).

  • GpuMemoryUtilizationAgent: (Agent) GPU memory usage (%).

  • MemoryUtilization: (Agent) memory usage (%).

  • LoadAverage: (Agent) average system load.

  • TcpConnection: (Agent) total number of TCP connections.

  • TcpConnection: (Agent) number of established TCP connections.

  • PackagesNetOut: (Agent) number of packets sent by the internal NIC (packets/s).

  • PackagesNetIn: (Agent) number of packets received by the internal NIC (packets/s).

  • PackagesNetOut: (Agent) number of packets sent by the public NIC (packets/s).

  • PackagesNetIn: (Agent) number of packets received by the public NIC (packets/s).

  • EciPodCpuUtilization: CPU utilization (%).

  • EciPodMemoryUtilization: memory usage (%).

  • LoadBalancerRealServerAverageQps: (ALB) average QPS per server in a server group (queries/s).

For more information, see System monitoring event-triggered nodes.

CpuUtilization

ComparisonOperator

string

The comparison operator between the statistical value and the threshold of the monitoring metric in the multi-metric alert rule. This operator specifies the condition under which the alert is triggered. 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: <.

Default value: >=.

>=

Period

integer

The statistical period for the monitoring metric data in the multi-metric alert rule, in seconds. Valid values:

Catatan

Only ECS-type scaling groups support a 15-second statistical period.

900

Statistics

string

The method used to aggregate the monitoring metric data in the multi-metric alert rule. Valid values:

  • Average: average value.

  • Minimum: minimum value.

  • Maximum: maximum value.

Average

Threshold

number

The threshold of the monitoring metrics in the multi-metric alert rule. The scaling rule is triggered when the threshold expression is met for the specified number of times.

40.0

ExpressionsLogicOperator

string

The logical operator between multi-metric alert conditions. Valid values:

  • &&: An alert is triggered only when all monitoring metrics meet the alert conditions. All expressions in the multi-metric alert rule must evaluate to true before an alert is triggered.

  • ||: An alert is triggered when any one of the monitoring metrics meets the alert condition.

&&

HybridMonitorNamespace

string

The ID of the Hybrid Cloud Monitoring monitoring metrics repository.

To manage metric repositories, see Manage metric 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 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 activities.

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 metrics in the Hybrid Cloud Monitoring metric repository.

AliyunSmq_NumberOfMessagesVisible

Statistic

string

The aggregation method for 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 key of the metric dimension.

queue

DimensionValue

string

The value of the metric dimension.

testQueue

PromQL

string

The PromQL query statement for Hybrid Cloud Monitoring.

(avg(last_over_time(AliyunMnsnew_ActiveMessages{region='cn-hangzhou',userId='123456****',queue='testQueue'}[900s])) by (userId))/(avg(last_over_time(AliyunEss_RunningInstanceCount{instanceId='asg-bp1****'}[900s])) by (userId) != 0)

Contoh

Respons sukses

JSONformat

{
  "PageSize": 10,
  "RequestId": "871C7C53-34A4-45AA-8C14-4B72FA6A****",
  "PageNumber": 1,
  "TotalCount": 2,
  "AlarmList": {
    "Alarm": [
      {
        "AlarmTaskId": "asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****",
        "MetricName": "CpuUtilization",
        "EvaluationCount": 3,
        "State": "ALARM",
        "Period": 300,
        "ScalingGroupId": "asg-bp18p2yfxow2dloq****",
        "ComparisonOperator": ">=",
        "Effective": "* * * * * ?",
        "Description": "Test alarm task.",
        "MetricType": "system",
        "Name": "TestAlarmTask",
        "Threshold": 80,
        "Enable": true,
        "Statistics": "Average",
        "Dimensions": {
          "Dimension": [
            {
              "DimensionKey": "device",
              "DimensionValue": "eth0"
            }
          ]
        },
        "AlarmActions": {
          "AlarmAction": [
            "ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****"
          ]
        },
        "Expressions": {
          "Expression": [
            {
              "MetricName": "CpuUtilization",
              "ComparisonOperator": ">=",
              "Period": 900,
              "Statistics": "Average",
              "Threshold": 40
            }
          ]
        },
        "ExpressionsLogicOperator": "&&",
        "HybridMonitorNamespace": "aliyun-test",
        "HybridMetrics": {
          "HybridMetric": [
            {
              "Id": "a",
              "Expression": "(a+b)/2",
              "MetricName": "AliyunSmq_NumberOfMessagesVisible",
              "Statistic": "Average",
              "Dimensions": {
                "Dimension": [
                  {
                    "DimensionKey": "queue",
                    "DimensionValue": "testQueue"
                  }
                ]
              }
            }
          ]
        },
        "PromQL": "(avg(last_over_time(AliyunMnsnew_ActiveMessages{region='cn-hangzhou',userId='123456****',queue='testQueue'}[900s])) by (userId))/(avg(last_over_time(AliyunEss_RunningInstanceCount{instanceId='asg-bp1****'}[900s])) by (userId) != 0)"
      }
    ]
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.