Modifies an event-triggered task.
Operation description
If you create an event-triggered task of the custom monitoring type (MetricType=custom), you must first report custom monitoring metrics to CloudMonitor. For more information, see Event-triggered tasks for custom monitoring.
- When you create an event-triggered task, you must specify a metric (MetricName) and configure dimension information (Dimension.N.DimensionKey and Dimension.N.DimensionValue) to determine the aggregation scope of the metric data 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 a custom monitoring event-triggered task (MetricType=custom) depend on your custom monitoring metrics.
For more information about the metrics supported by system monitoring event-triggered tasks (MetricType=system), see Event-triggered tasks for system monitoring.
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
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:ModifyAlarm |
update |
*ScalingGroup
|
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 name of the metric. Valid values vary based on the monitoring type of the event-triggered task:
For more information, see Event-triggered tasks for system monitoring. |
MemoryUtilization |
| MetricType |
string |
No |
The type of the metric. Valid values:
|
system |
| Period |
integer |
No |
The statistical period for the metric data, in seconds. Valid values: Note
A statistical period of 15 seconds is applicable only to metrics collected by the CloudMonitor agent (metrics that start with Agent) when monitoring ECS-type scaling groups. For all other metrics, the statistical period can be set to 60, 120, 300, or 900 seconds. |
300 |
| Statistics |
string |
No |
The method used to aggregate the metric data. Valid values:
|
Average |
| Threshold |
number |
No |
The threshold of the monitoring metrics in a multi-metric event-triggered task. The scaling rule is executed when the threshold expression is met the specified number of times. |
80 |
| ComparisonOperator |
string |
No |
The comparison operator between the statistical value and the threshold of the metric. The comparison operator indicates the relationship in which the statistical value and the threshold can satisfy the condition. Valid values:
|
>= |
| EvaluationCount |
integer |
No |
The number of 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% in three consecutive statistical results. |
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 |
Specifies the effective period of the event-triggered task. This parameter follows cron expressions. The default format is
Note
The value of this parameter is in the UTC+8 time zone by default. You can add time zone information Examples and descriptions:
|
TZ=+00 * * 1-2 * * ? |
| AlarmActions |
array |
No |
The list of unique identifiers of the scaling rules associated with the event-triggered task. |
|
|
string |
No |
The list of unique identifiers of the scaling rules associated with the event-triggered task. |
ari:acs:ess:cn-hangzhou:140692647****:scalingrule/asr-bp163l21e07uhn**** |
|
| Dimensions |
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 information associated with the metric. Valid values vary based on the monitoring type of the event-triggered node:
|
device |
| DimensionValue |
string |
No |
The value of the dimension information associated with the metric. Valid values are determined by Dimension.N.DimensionKey:
|
eth0 |
| Expressions |
array<object> |
No |
The monitoring metrics of the multi-metric event-triggered task. |
|
|
object |
No |
The monitoring metrics of the multi-metric event-triggered task. |
||
| ComparisonOperator |
string |
No |
The comparison operator between the statistical value and the threshold of the metric. The comparison operator indicates the relationship in which the statistical value and the threshold can satisfy the condition. Valid values:
Default value: >=. |
>= |
| MetricName |
string |
No |
The name of the monitoring metric in the multi-metric event-triggered node. Valid values vary based on the monitoring type of the event-triggered task:
For more information, see Event-triggered tasks for system monitoring. |
CpuUtilization |
| Period |
integer |
No |
The statistical period for the metric data in the multi-metric event-triggered task, in seconds. Valid values: Note
A statistical period of 15 seconds is applicable only to metrics collected by the CloudMonitor agent (metrics that start with Agent) when monitoring ECS-type scaling groups. For all other metrics, the statistical period can be set to 60, 120, 300, or 900 seconds. Default value: 300. |
300 |
| Statistics |
string |
No |
The method used to aggregate the metric data in the multi-metric event-triggered task. Valid values:
|
Average |
| Threshold |
number |
No |
The threshold of the monitoring metrics in a multi-metric event-triggered task. The scaling rule is executed when the threshold expression is met the specified number of times. |
40.0 |
| ExpressionsLogicOperator |
string |
No |
The relationship between multiple monitoring metrics conditions. Valid values:
Default value: |
&& |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| AlarmTaskId |
string |
The ID of the event-triggered task. |
asg-bp1hvbnmkl10vll5****_83948190-acdd-483f-98f7-b77f4778**** |
| RequestId |
string |
The request ID. |
BACACF83-7070-4953-A8FD-D81F89F1**** |
Examples
Success response
JSON format
{
"AlarmTaskId": "asg-bp1hvbnmkl10vll5****_83948190-acdd-483f-98f7-b77f4778****",
"RequestId": "BACACF83-7070-4953-A8FD-D81F89F1****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.