All Products
Search
Document Center

Auto Scaling:DescribeAlarms

Last Updated:Aug 28, 2026

Queries event-triggered tasks, including their configurations and monitoring data changes. This helps you detect system resource anomalies early and ensure system stability.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:DescribeAlarms

get

*ScalingGroup

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the event-triggered task.

cn-qingdao

ScalingGroupId

string

No

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

asg-bp18p2yfxow2dloq****

AlarmTaskId

string

No

The ID of the event-triggered task.

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

State

string

No

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

  • ALARM: The alert condition is met and an alert is triggered.

  • OK: The alert condition is not met.

  • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.

OK

IsEnable

boolean

No

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

  • true: enables the event-triggered task.

  • false: disables the event-triggered task.

true

MetricType

string

No

The metric type. Valid values:

  • system: a system metric of CloudMonitor

  • custom: a custom metric that is reported to CloudMonitor.

  • hybrid: a metric of Hybrid Cloud Monitoring.

true

MetricName

string

No

The metric name.

CpuUtilization

PageSize

integer

No

The number of entries per page. Valid values: 1 to 50.

Default value: 10.

10

PageNumber

integer

No

The page number. Pages start from page 1.

Default value: 1.

1

Response elements

Element

Type

Description

Example

object

The response parameters.

PageSize

integer

The number of entries returned per page.

10

RequestId

string

The ID of the request.

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

PageNumber

integer

The page number of the returned page.

1

TotalCount

integer

The total number of event-triggered tasks.

2

AlarmList

array<object>

The event-triggered tasks.

array<object>

The event-triggered task.

AlarmTaskId

string

The ID of the event-triggered task.

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

MetricName

string

The metric name. Valid values:

  • CpuUtilization: the CPU utilization of an Elastic Compute Service (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 virtual private cloud (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 queries per second (QPS) of an instance.

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

CpuUtilization

EvaluationCount

integer

The number of consecutive times the threshold must be reached before a scaling rule is executed. For example, if you set this parameter to 3, the average CPU utilization must reach or exceed 80% three times in a row before a scaling rule is executed.

3

State

string

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

  • ALARM: The alert condition is met and an alert is triggered.

  • OK: The alert condition is not met.

  • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.

ALARM

Period

integer

The statistical period of the metric data. Unit: seconds. Valid values:

  • 15

  • 60

  • 120

  • 300

  • 900

Note

You can set the value of this parameter to 15 Seconds only for scaling groups of the ECS type.

300

ScalingGroupId

string

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

asg-bp18p2yfxow2dloq****

ComparisonOperator

string

The operator used to compare the metric value and the metric 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: <.

>=

Effective

string

The effective period of the event-triggered task.

Test

Description

string

The description of the event-triggered task.

Test alarm task.

MetricType

string

The type of the metric. Valid values:

  • system: system metrics of CloudMonitor

  • custom: custom metrics that are reported to CloudMonitor.

  • hybrid: metrics of Hybrid Cloud Monitoring.

system

Name

string

The name of the event-triggered task.

TestAlarmTask

Threshold

number

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

80.0

Enable

boolean

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

  • true

  • false

true

Statistics

string

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

  • Average: the average value

  • Minimum: the minimum value

  • Maximum: the maximum value

Average

Dimensions

array<object>

The metric dimensions.

object

Details of the dimensions.

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 depends 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

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

string

The unique identifier of the scaling rule that is associated with the event-triggered task.

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

Expressions

array<object>

The alert conditions of the multi-metric alert rule.

object

The expressions that are specified in the multi-metric alert rule.

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

Note

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 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. When the threshold is reached the specified number of times within the specified period, a scaling rule is executed.

40.0

ExpressionsLogicOperator

string

The relationship between the trigger conditions in the multi-metric alert rule. Valid values:

  • &&: An alert is triggered only if all metrics in the multi-metric alert rule meet their trigger conditions. In this case, an alert is triggered only if the results of all trigger conditions that are specified in the multi-metric alert rule are true.

  • ||: An alert is triggered only if one of the metrics in the multi-metric alert rule meets its trigger condition.

&&

HybridMonitorNamespace

string

The ID of the Hybrid Cloud Monitoring namespace.

For information about how to manage Hybrid Cloud Monitoring namespaces, see Manage namespaces.

aliyun-test

HybridMetrics

array<object>

The Hybrid Cloud Monitoring metrics.

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. The result is 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. 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

The PromQL statement of 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)

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.