All Products
Search
Document Center

Auto Scaling:DescribeAlarms

Last Updated:Dec 11, 2024

Queries event-triggered tasks. You can call the DescribeAlarms operation to learn about the configurations of event-triggered tasks and keep updated on monitoring data changes. This helps you troubleshoot system resource issues at the earliest opportunity and ensures system stability and reliability.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ess:DescribeAlarmsget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the event-triggered task.

cn-qingdao
ScalingGroupIdstringNo

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

asg-bp18p2yfxow2dloq****
AlarmTaskIdstringNo

The ID of the event-triggered task.

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

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
IsEnablebooleanNo

Specifies whether to enable the event-triggered task. Valid values:

  • true: enables the event-triggered task.
  • false: disables the event-triggered task.
true
MetricTypestringNo

The metric type. Valid values:

  • system: system metrics of CloudMonitor
  • custom: custom metrics that are reported to CloudMonitor.
true
MetricNamestringNo

The metric name.

CpuUtilization
PageSizeintegerNo

The number of entries per page. Maximum value: 50.

Default value: 10.

10
PageNumberintegerNo

The page number. Pages start from page 1.

Default value: 1.

1

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

PageSizeinteger

The number of entries returned per page.

10
RequestIdstring

The ID of the request.

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

The page number of the returned page.

1
TotalCountinteger

The total number of event-triggered tasks.

2
AlarmListarray<object>

The event-triggered tasks.

Alarmobject

The event-triggered task.

AlarmTaskIdstring

The ID of the event-triggered task.

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

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
EvaluationCountinteger

The number of consecutive times that 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
Statestring

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
Periodinteger

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
ScalingGroupIdstring

The ID of the scaling group to which the event-triggered task is associated.

asg-bp18p2yfxow2dloq****
ComparisonOperatorstring

The operator that is 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: <.
>=
Effectivestring

The effective period of the event-triggered task.

Test
Descriptionstring

The description of the event-triggered task.

Test alarm task.
MetricTypestring

The metric type. Valid values:

  • system: system metrics of CloudMonitor
  • custom: custom metrics that are reported to CloudMonitor.
system
Namestring

The name of the event-triggered task.

TestAlarmTask
Thresholdfloat

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

80.0
Enableboolean

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

  • true
  • false
true
Statisticsstring

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

  • Average: the average value
  • Minimum: the minimum value
  • Maximum: the maximum value
Average
Dimensionsarray<object>

The metric dimensions.

Dimensionobject

Details of the dimensions.

DimensionKeystring

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
DimensionValuestring

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
AlarmActionsarray

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

AlarmActionstring

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

ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****
Expressionsarray<object>

The alert conditions of the multi-metric alert rule.

Expressionobject

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

MetricNamestring

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
ComparisonOperatorstring

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: <.
>=
Periodinteger

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
Statisticsstring

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
Thresholdfloat

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
ExpressionsLogicOperatorstring

The relationship between the trigger conditions that are specified 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.
&&

Examples

Sample success responses

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": "",
      "HybridMetrics": [
        {
          "Id": "",
          "Expression": "",
          "MetricName": "",
          "Statistic": "",
          "Dimensions": [
            {
              "DimensionKey": "",
              "DimensionValue": ""
            }
          ]
        }
      ],
      "PromQL": ""
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-09-13The response structure of the API has changedView Change Details