All Products
Search
Document Center

Auto Scaling:DescribeAlarms

Last Updated:Jun 12, 2026

Mengkueri informasi tentang tugas yang dipicu peristiwa untuk membantu Anda memahami konfigurasi dan tren data pemantauan dari tugas yang dipicu peristiwa yang ada, mendeteksi pengecualian sumber daya sistem secara real-time, dan memastikan stabilitas serta keandalan sistem.

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 peristiwa berada.

cn-qingdao

ScalingGroupId

string

No

ID grup penskalaan yang terkait dengan tugas yang dipicu peristiwa.

asg-bp18p2yfxow2dloq****

AlarmTaskId

string

No

ID tugas yang dipicu peristiwa.

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

State

string

No

Status tugas yang dipicu 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 peristiwa diaktifkan. Nilai yang valid:

  • true: Diaktifkan.

  • false: Dinonaktifkan.

true

MetricType

string

No

Jenis metrik pemantauan. Nilai yang valid:

  • system: menggunakan metrik sistem dari CloudMonitor.

  • custom: menggunakan metrik kustom yang dilaporkan ke CloudMonitor.

  • hybrid: menggunakan metrik dari Hybrid Cloud Monitoring.

true

MetricName

string

No

Nama metrik pemantauan.

CpuUtilization

PageSize

integer

No

Jumlah entri per halaman untuk kueri paginasi. Nilai maksimum: 50.

Nilai default: 10.

10

PageNumber

integer

No

Nomor halaman dari daftar aturan penskalaan. Halaman dimulai dari halaman 1.

Nilai default: 1.

1

Elemen respons

Element

Type

Description

Example

object

Struktur respons.

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 peristiwa.

2

AlarmList

array<object>

Daftar tugas yang dipicu peristiwa.

array<object>

Daftar tugas yang dipicu peristiwa.

AlarmTaskId

string

ID tugas yang dipicu peristiwa.

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

MetricName

string

Nama metrik pemantauan. Nilai yang valid:

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

  • ConcurrentConnections: (ECS) jumlah koneksi bersamaan ke instans ECS.

  • IntranetTx: (ECS) lalu lintas keluar melalui jaringan internal (KB/menit).

  • IntranetRx: (ECS) lalu lintas masuk melalui jaringan internal (KB/menit).

  • VpcInternetTx: (ECS) lalu lintas keluar melalui Internet (KB/menit).

  • VpcInternetRx: (ECS) lalu lintas masuk melalui Internet (KB/menit).

  • SystemDiskReadBps: (ECS) BPS baca cloud disk sistem (byte/dtk).

  • SystemDiskWriteBps: (ECS) BPS tulis cloud disk sistem (byte/dtk).

  • SystemDiskReadOps: (ECS) IOPS baca cloud disk sistem (hitungan/dtk).

  • SystemDiskWriteOps: (ECS) IOPS tulis cloud disk sistem (hitungan/dtk).

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

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

  • GpuMemoryFreeUtilizationAgent: (Agent) tingkat memori GPU yang tidak terpakai (%).

  • GpuMemoryUtilizationAgent: (Agent) utilisasi memori GPU (%).

  • MemoryUtilization: (Agent) utilisasi memori (%).

  • LoadAverage: (Agent) rata-rata beban sistem.

  • TcpConnection: (Agent) jumlah total koneksi TCP.

  • TcpConnection: (Agent) jumlah koneksi TCP yang terhubung.

  • PackagesNetOut: (Agent) jumlah paket yang dikirim oleh NIC internal (paket/dtk).

  • PackagesNetIn: (Agent) jumlah paket yang diterima oleh NIC internal (paket/dtk).

  • PackagesNetOut: (Agent) jumlah paket yang dikirim oleh NIC publik (paket/dtk).

  • PackagesNetIn: (Agent) jumlah paket yang diterima oleh NIC publik (paket/dtk).

  • EciPodCpuUtilization: utilisasi CPU (%).

  • EciPodMemoryUtilization: utilisasi memori (%).

  • LoadBalancerRealServerAverageQps: (ALB) rata-rata QPS per server dalam grup server (hitungan/dtk).

Untuk informasi lebih lanjut, lihat Tugas yang dipicu peristiwa untuk pemantauan sistem.

CpuUtilization

EvaluationCount

integer

Jumlah kali berturut-turut ekspresi ambang batas harus terpenuhi sebelum aturan penskalaan dipicu. Misalnya, rata-rata utilisasi CPU harus lebih besar dari atau sama dengan 80% selama tiga periode statistik berturut-turut.

3

State

string

Status tugas yang dipicu peristiwa. Nilai yang valid:

  • ALARM: Kondisi peringatan terpenuhi.

  • OK: Kondisi peringatan tidak terpenuhi.

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

ALARM

Period

integer

Periode statistik untuk data metrik pemantauan, dalam detik. Nilai yang valid:

Catatan

Hanya grup penskalaan bertipe ECS yang mendukung periode statistik 15 detik.

300

ScalingGroupId

string

ID grup penskalaan yang terkait dengan tugas yang dipicu peristiwa.

asg-bp18p2yfxow2dloq****

ComparisonOperator

string

Operator perbandingan antara nilai statistik dan ambang batas metrik pemantauan. Operator ini menentukan kondisi di mana nilai statistik memenuhi ambang batas. Nilai yang valid:

  • Nilai statistik lebih besar dari atau sama dengan ambang batas. Nilai: >=.

  • Nilai statistik kurang dari atau sama dengan ambang batas. Nilai: <=.

  • Nilai statistik lebih besar dari ambang batas. Nilai: >.

  • Nilai statistik kurang dari ambang batas. Nilai: <.

>=

Effective

string

Periode efektif tugas yang dipicu peristiwa.

Test

Description

string

Deskripsi tugas yang dipicu peristiwa.

Test alarm task.

MetricType

string

Jenis metrik pemantauan. Nilai yang valid:

  • system: menggunakan metrik sistem dari CloudMonitor.

  • custom: menggunakan metrik kustom yang dilaporkan ke CloudMonitor.

  • hybrid: menggunakan metrik dari Hybrid Cloud Monitoring.

system

Name

string

Nama tugas yang dipicu peristiwa.

TestAlarmTask

Threshold

number

Ambang batas metrik pemantauan. Aturan penskalaan dipicu ketika ekspresi ambang batas terpenuhi selama jumlah kali yang ditentukan.

80.0

Enable

boolean

Menunjukkan apakah tugas yang dipicu peristiwa diaktifkan. Nilai yang valid:

  • true: Diaktifkan.

  • false: Dinonaktifkan.

true

Statistics

string

Metode yang digunakan untuk mengagregasi data metrik pemantauan. Nilai yang valid:

  • Average: nilai rata-rata.

  • Minimum: nilai minimum.

  • Maximum: nilai maksimum.

Average

Dimensions

array<object>

Informasi dimensi yang terkait dengan metrik pemantauan.

object

Informasi dimensi yang terkait dengan metrik pemantauan.

DimensionKey

string

The dimension key of the metric. Valid values:

  • user_id: the ID of your Alibaba Cloud account.

  • scaling_group: the scaling group that is monitored by the event-triggered task.

  • device: the NIC type.

  • state: the status of the TCP connection.

device

DimensionValue

string

The dimension value of the metric. The value of DimensionValue varies based on the value of DimensionKey.

  • If you set DimensionKey to user_id, the system specifies the value of DimensionValue.

  • If you set DimensionKey to scaling_group, the system specifies the value of DimensionValue.

  • If you set DimensionKey to device, you can set DimensionValue to eth0 or eth1.

    • For instances of the classic network type, eth0 indicates the internal NIC. Only one eth0 NIC exists on each instance that resides in VPCs.

    • For instances of the classic network type, eth1 indicates the public NIC.

  • If you set DimensionKey to state, you can set DimensionValue to TCP_TOTAL or ESTABLISHED.

    • TCP_TOTAL indicates the total number of TCP connections.

    • ESTABLISHED indicates the number of TCP connections that are established.

eth0

AlarmActions

array

Daftar pengidentifikasi unik dari aturan penskalaan yang terkait dengan tugas yang dipicu peristiwa.

string

Daftar pengidentifikasi unik dari aturan penskalaan yang terkait dengan tugas yang dipicu peristiwa.

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

Expressions

array<object>

Informasi tentang aturan peringatan multi-metrik.

object

Informasi tentang aturan peringatan multi-metrik.

MetricName

string

The name of the metric that is specified in the multi-metric alert rule. Valid values:

  • CpuUtilization: the CPU utilization of an ECS instance. Unit: %.

  • ConcurrentConnections: the number of current connections to an ECS instance.

  • IntranetTx: the outbound traffic over an internal network. Unit: KB/min.

  • IntranetRx: the inbound traffic over an internal network. Unit: KB/min.

  • VpcInternetTx: the outbound traffic over a VPC. Unit: KB/min.

  • VpcInternetRx: the inbound traffic over a VPC. Unit: KB/min.

  • SystemDiskReadBps: the number of bytes read from the system disk per second.

  • SystemDiskWriteBps: the number of bytes written to the system disk per second.

  • SystemDiskReadOps: the read IOPS of the system disk. Unit: counts/s.

  • SystemDiskWriteOps: the write IOPS of the system disk. Unit: counts/s.

  • CpuUtilizationAgent: the CPU utilization. Unit: %.

  • GpuUtilizationAgent: the GPU utilization. Unit: %.

  • GpuMemoryFreeUtilizationAgent: the idle GPU memory usage. Unit: %.

  • GpuMemoryUtilizationAgent: the GPU memory usage. Unit: %.

  • MemoryUtilization: the memory usage. Unit: %.

  • LoadAverage: the average system load.

  • TcpConnection: the total number of TCP connections.

  • TcpConnection: the number of established TCP connections.

  • PackagesNetOut: the number of packets sent by the internal NIC. Unit: counts/s.

  • PackagesNetIn: the number of packets received by the internal NIC. Unit: counts/s.

  • PackagesNetOut: the number of packets sent by the public NIC. Unit: counts/s.

  • PackagesNetIn: the number of packets received by the public NIC. Unit: counts/s.

  • EciPodCpuUtilization: the CPU utilization. Unit: %.

  • EciPodMemoryUtilization: the memory usage. Unit: %.

  • LoadBalancerRealServerAverageQps: the QPS of an instance.

For more information, see Event-triggered tasks of the system monitoring type.

CpuUtilization

ComparisonOperator

string

The operator that is used to compare the metric value and the threshold.

  • Valid value if the metric value is greater than or equal to the threshold: >=.

  • Valid value if the metric value is less than or equal to the threshold: <=.

  • Valid value if the metric value is greater than the threshold: >.

  • Valid value if the metric value is less than the threshold: <.

>=

Period

integer

The statistical period of the metric data in the multi-metric alert rule. Unit: seconds. Valid values:

  • 15

  • 60

  • 120

  • 300

  • 900

Catatan

If your scaling group is of the ECS type and the event-triggered task that is associated with your scaling group monitors CloudMonitor metrics, you can set Period to 15. In most cases, the name of a CloudMonitor metric contains Agent.

900

Statistics

string

The method that is used to aggregate statistics about the metrics in the multi-metric alert rule. Valid values:

  • Average: the average value

  • Minimum: the minimum value

  • Maximum: the maximum value

Average

Threshold

number

The threshold of the metric value. If the threshold is reached the specified number of times within the specified period, a scaling rule is executed.

40.0

ExpressionsLogicOperator

string

Operator logika antara kondisi peringatan multi-metrik. Nilai yang valid:

  • &&: Peringatan dipicu hanya ketika semua metrik pemantauan memenuhi kondisi peringatan. Semua ekspresi dalam aturan peringatan multi-metrik harus bernilai true sebelum peringatan dipicu.

  • ||: Peringatan dipicu ketika salah satu metrik pemantauan memenuhi kondisi peringatan.

&&

HybridMonitorNamespace

string

ID repositori metrik pemantauan Hybrid Cloud Monitoring.

Untuk mengelola repositori metrik, lihat Mengelola repositori metrik.

aliyun-test

HybridMetrics

array<object>

Pengaturan metrik pemantauan Hybrid Cloud Monitoring. Untuk informasi lebih lanjut tentang cara mengonfigurasi pengaturan ini, lihat Menggunakan aturan pelacakan target kustom berbasis formula.

array<object>

Id

string

The reference ID of the metric in the metric expression.

a

Expression

string

The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events.

The expression is written in Reverse Polish Notation (RPN) format and supports only the following operators: +, -, *, /.

(a+b)/2

MetricName

string

The name of the Hybrid Cloud Monitoring metric.

AliyunSmq_NumberOfMessagesVisible

Statistic

string

The statistical method of the metric value. Valid values:

  • Average: The average value of all metric values within a specified interval is calculated.

  • Minimum: The minimum value of all metric values within a specified interval is calculated.

  • Maximum: The maximum value of all metric values within a specified interval is calculated.

Average

Dimensions

array<object>

The metric dimensions. This parameter is used to specify the monitored resources.

object

DimensionKey

string

The key of the metric dimension.

queue

DimensionValue

string

The key of the metric dimension.

testQueue

PromQL

string

Pernyataan kueri PromQL untuk 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": [
    {
      "AlarmTaskId": "asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****",
      "MetricName": "CpuUtilization",
      "EvaluationCount": 3,
      "State": "ALARM",
      "Period": 300,
      "ScalingGroupId": "asg-bp18p2yfxow2dloq****",
      "ComparisonOperator": ">=",
      "Effective": "Test",
      "Description": "Test alarm task.",
      "MetricType": "system",
      "Name": "TestAlarmTask",
      "Threshold": 80,
      "Enable": true,
      "Statistics": "Average",
      "Dimensions": [
        {
          "DimensionKey": "device",
          "DimensionValue": "eth0"
        }
      ],
      "AlarmActions": [
        "ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****"
      ],
      "Expressions": [
        {
          "MetricName": "CpuUtilization",
          "ComparisonOperator": ">=",
          "Period": 900,
          "Statistics": "Average",
          "Threshold": 40
        }
      ],
      "ExpressionsLogicOperator": "&&",
      "HybridMonitorNamespace": "aliyun-test",
      "HybridMetrics": [
        {
          "Id": "a",
          "Expression": "(a+b)/2",
          "MetricName": "AliyunSmq_NumberOfMessagesVisible",
          "Statistic": "Average",
          "Dimensions": [
            {
              "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.