All Products
Search
Document Center

Auto Scaling:ModifyAlarm

Last Updated:Sep 17, 2026

Modifies an event-triggered task.

Operation description

Operation description

  • If you create an event-triggered task of the custom monitoring type (MetricType=custom), you must report monitoring metrics to CloudMonitor in advance. For more information, see Event-triggered tasks for custom monitoring.

  • When you create an event-triggered task, you must specify a metric (MetricName) and use dimension information (Dimension.N.DimensionKey and Dimension.N.DimensionValue) to determine the scope of data aggregation for the metric in the scaling group. For example, you can specify user_id and scaling_group to aggregate the metric data of all ECS instances or elastic container instances in the scaling group of the specified user.

    • The metrics of event-triggered tasks for custom monitoring (MetricType=custom) depend on your monitoring metrics.

    • For more information about the metrics supported by event-triggered tasks for system monitoring (MetricType=system), see Event-triggered tasks for system monitoring.

Note

In the dimension information, user_id and scaling_group are automatically populated by the system. You must manually specify device and state. For more information, see the Dimension.N.DimensionKey and Dimension.N.DimensionValue parameters.

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

update

*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

AlarmTaskId

string

Yes

The ID of the event-triggered task.

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

Name

string

No

The name of the event-triggered task.

alarmtask****

Description

string

No

The description of the event-triggered task.

Test alarm task.

MetricName

string

No

The metric name. Valid values vary based on the monitoring type of the event-triggered task:

  • If the event-triggered task is of the custom monitoring type (MetricType=custom), valid values are your custom metrics.

  • If the event-triggered task is of the system monitoring type (MetricType=system), valid values:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    • 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 NIC (count/s).

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

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

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

    • EciPodCpuUtilization: CPU utilization (%).

    • EciPodMemoryUtilization: memory utilization (%).

    • LoadBalancerRealServerAverageQps: (ALB) average QPS per server in the server group (count/s).

For more information, see Event-triggered tasks for system monitoring.

MemoryUtilization

MetricType

string

No

The monitoring type. Valid values:

  • system: uses CloudMonitor system metrics.

  • custom: uses custom metrics reported to CloudMonitor.

system

Period

integer

No

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

Note

Only scaling groups of the ECS type support a statistical period of 15 seconds.

300

Statistics

string

No

The method used to aggregate metric data. Valid values:

  • Average: average value.

  • Minimum: minimum value.

  • Maximum: maximum value.

Average

Threshold

number

No

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

80

ComparisonOperator

string

No

The comparison operator between the metric value and the threshold. This parameter specifies the condition under which the metric value meets the threshold. Valid values:

  • The metric value is greater than or equal to the threshold. Value: >=.

  • The metric value is less than or equal to the threshold. Value: <=.

  • The metric value is greater than the threshold. Value: >.

  • The metric value is less than the threshold. Value: <.

>=

EvaluationCount

integer

No

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

GroupId

integer

No

The ID of the CloudMonitor application group to which the custom metric belongs. This parameter is required only when MetricType is set to custom.

4055401

Effective

string

No

The effective period of the event-triggered task.

This parameter follows cron expressions. The default format is X X X X X ?, where:

  • X: a placeholder for a field, which represents seconds, minutes, hours, day of month, and month in sequence. X can be a specific value or a special character with logical meaning. For more information about the valid values of X, see Cron expression.

  • ?: specifies no value.

Note

The values of this parameter are in the UTC+8 time zone by default. You can add time zone information TZ=+yy before the cron expression to specify a time zone, where y represents the time zone offset. For example, TZ=+00 * * 1-2 * * ? specifies that the event-triggered task takes effect between 01:00 and 02:59 in the UTC+0 time zone every day.

Examples and descriptions:

  • * * * * * ? : takes effect at all times.

  • * * 17-18 * * ? : takes effect between 17:00 and 18:59 in the UTC+8 time zone every day.

  • TZ=+00 * * 1-2 * * ?: takes effect between 01:00 and 02:59 in the UTC+0 time zone every day.

TZ=+00 * * 1-2 * * ?

AlarmAction

array

No

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

ari:acs:ess:cn-hangzhou:140692647****:scalingrule/asr-bp163l21e07uhn****

string

No

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

ari:acs:ess:cn-hangzhou:140692647****:scalingrule/asr-bp163l21e07uhn****

Dimension

array<object>

No

The dimension information associated with the metric.

object

No

The dimension information associated with the metric.

DimensionKey

string

No

The key of the dimension associated with the metric. Valid values vary based on the monitoring type of the event-triggered task:

  • If the event-triggered task is of the custom monitoring type (MetricType=custom), valid values are not restricted and can be specified by you.

  • If the event-triggered task is of the system monitoring type (MetricType=system), valid values:

    • user_id: your account ID.

    • scaling_group: the scaling group being monitored.

    • device: the type of the network interface controller (NIC) device.

    • state: the state of the TCP connection.

    • rulePool: the server group specified for the ALB QPS monitoring metrics node.

device

DimensionValue

string

No

The value of the dimension associated with the metric. Valid values are determined by Dimension.N.DimensionKey:

  • If Dimension.N.DimensionKey is a custom value, meaning the event-triggered task is of the custom monitoring type (MetricType=custom), valid values are not restricted and can be specified by you.

  • If Dimension.N.DimensionKey is a system-specified value, meaning the event-triggered task is of the system monitoring type (MetricType=system), valid values:

    • user_id: automatically populated by the system.

    • scaling_group: automatically populated by the system.

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

    • state:

      • TCP_TOTAL: the total number of TCP connections.

      • ESTABLISHED: the number of established TCP connections.

eth0

Expression

array<object>

No

The information about multi-metric alert rules.

object

No

The information about multi-metric alert rules.

MetricName

string

No

The monitoring metric name for the multi-metric alert rule. Valid values vary based on the monitoring type of the event-triggered node:

  • If the event-triggered task is of the custom monitoring type (MetricType=custom), valid values are your custom metrics.

  • If the event-triggered task is of the system monitoring type (MetricType=system), valid values:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    • 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 network interface controller (NIC) (count/s).

    • PackagesNetIn: (Agent) number of packets received by the network interface controller (NIC) (count/s).

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

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

    • EciPodCpuUtilization: CPU utilization (%).

    • EciPodMemoryUtilization: memory utilization (%).

    • LoadBalancerRealServerAverageQps: (ALB) average QPS per server in the server group (count/s).

For more information, see Event-triggered tasks for system monitoring.

CpuUtilization

ComparisonOperator

string

No

The comparison operator between the metric value and the threshold for the multi-metric alert rule. This parameter specifies the condition under which the metric value meets the threshold. Valid values:

  • The metric value is greater than or equal to the threshold. Value: >=.

  • The metric value is less than or equal to the threshold. Value: <=.

  • The metric value is greater than the threshold. Value: >.

  • The metric value is less than the threshold. Value: <.

Default value: >=.

>=

Period

integer

No

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

Note

Only scaling groups of the ECS type support a statistical period of 15 seconds.

Default value: 300.

300

Statistics

string

No

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

  • Average: average value.

  • Minimum: minimum value.

  • Maximum: maximum value.

Average

Threshold

number

No

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

40.0

ExpressionsLogicOperator

string

No

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

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

  • ||: An alert is triggered when any monitoring metric meets the alert conditions.

Default value: &&.

&&

Response elements

Element

Type

Description

Example

object

AlarmTaskId

string

The ID of the event-triggered task.

asg-bp1hvbnmkl10vll5****

RequestId

string

The request ID.

BACACF83-7070-4953-A8FD-D81F89F1****

Examples

Success response

JSON format

{
  "AlarmTaskId": "asg-bp1hvbnmkl10vll5****",
  "RequestId": "BACACF83-7070-4953-A8FD-D81F89F1****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.