You can call this operation to create or modify a group alert rule.

Debugging

You can use API Explorer to perform debugging. API Explorer allows you to perform various operations to simplify API usage. For example, you can retrieve APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description 
Category String Yes ecs

The abbreviation of the service name. Valid values:

  • ECS (including Alibaba Cloud and non-Alibaba Cloud hosts)
  • RDS (ApsaraDB for RDS)
  • ADS (AnalyticDB)
  • SLB (Server Load Balancer)
  • VPC (Virtual Private Cloud)
  • APIGATEWAY (API Gateway)
  • CDN
  • CS (Container Service for Swarm)
  • DCDN (Dynamic Route for CDN)
  • DDOS (distributed denial of service)
  • EIP (Elastic IP)
  • ELASTICSEARCH (Elasticsearch)
  • EMR (E-MapReduce)
  • ESS (Auto Scaling)
  • HBASE (ApsaraDB for HBase)
  • IOT_EDGE (IoT Edge)
  • K8S_POD (k8s pod)
  • KVSTORE_SHARDING (ApsaraDB RDS for Redis cluster version)
  • KVSTORE_SPLITRW (ApsaraDB RDS for Redis read/write splitting version)
  • KVSTORE_STANDARD (ApsaraDB RDS for Redis standard version)
  • MEMCACHE (ApsaraDB RDS for Memcache)
  • MNS (Message Service)
  • MONGODB (ApsaraDB RDS for MongoDB replica set instances)
  • MONGODB_CLUSTER (ApsaraDB RDS for MongoDB cluster version)
  • MONGODB_SHARDING (ApsaraDB RDS for MongoDB sharded clusters)
  • MQ_TOPIC (Message Service topic)
  • OCS (original version of ApsaraDB RDS for Memcache)
  • OPENSEARCH (Open Search)
  • OSS (Object Storage Service)
  • POLARDB (ApsaraDB for POLARDB)
  • PETADATA (HybridDB for MySQL)
  • SCDN (Secure Content Delivery Network)
  • SHAREBANDWIDTHPACKAGES (shared bandwidth package)
  • SLS (Log Service)
  • VPN (VPN Gateway)
GroupId String Yes 123456

The ID of application group.

MetricName String Yes cpu_total

The name of the metric. For more information, call DescribeMetricMetaList or see Preset metrics reference.

Namespace String Yes acs_ecs_dashboard

The data namespace of the service. For more information, call DescribeMetricMetaList or see Preset metrics reference.

RuleId String Yes bfae2ca5b4e07d2c7278772eccda169808c7b****

The ID of the alert rule. The IDs of alert rules are generated by callers to ensure uniqueness.

Action String No PutGroupMetricRule

The operation that you want to perform. Set the value to PutGroupMetricRule.

Dimensions String No [{"instanceId":"xxxxxx"}]

The expended resource dimensions.

EffectiveInterval String No 00:00-23:59

The period when the alert rule is effective.

EmailSubject String No An alert occurs

The subject of the alert notification email.

Escalations.Critical.ComparisonOperator String  No GreaterThanOrEqualToThreshold

The comparison operator of the threshold for critical-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold
  • GreaterThanThreshold
  • LessThanOrEqualToThreshold
  • LessThanThreshold
  • NotEqualToThreshold
  • GreaterThanYesterday
  • LessThanYesterday
  • GreaterThanLastWeek
  • LessThanLastWeek
  • GreaterThanLastPeriod
  • LessThanLastPeriod
Escalations.Critical.Statistics String No Average

The statistical method for critical-level alerts. The statistical method varies with metric.

Escalations.Critical.Threshold String No 90

The threshold for critical-level alerts.

Escalations.Critical.Times Integer No 3

The consecutive number of times for which the metric value exceeds the threshold for critical-level alerts before an alert is triggered.

Escalations.Info.ComparisonOperator String No GreaterThanOrEqualToThreshold

The comparison operator of the threshold for info-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold
  • GreaterThanThreshold
  • LessThanOrEqualToThreshold
  • LessThanThreshold
  • NotEqualToThreshold
  • GreaterThanYesterday
  • LessThanYesterday
  • GreaterThanLastWeek
  • LessThanLastWeek
  • GreaterThanLastPeriod
  • LessThanLastPeriod
Escalations.Info.Statistics String No Average

The statistical method for info-level alerts.

Escalations.Info.Threshold String No 90

The threshold for info-level alerts.

Escalations.Info.Times Integer No 3

The consecutive number of times for which the metric value exceeds the threshold for info-level alerts before an alert is triggered.

Escalations.Warn.ComparisonOperator String No GreaterThanOrEqualToThreshold

The comparison operator of the threshold for warn-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold
  • GreaterThanThreshold
  • LessThanOrEqualToThreshold
  • LessThanThreshold
  • NotEqualToThreshold
  • GreaterThanYesterday
  • LessThanYesterday
  • GreaterThanLastWeek
  • LessThanLastWeek
  • GreaterThanLastPeriod
  • LessThanLastPeriod
Escalations.Warn.Statistics String No Average

The statistical method for warn-level alerts.

Escalations.Warn.Threshold String No 90

The threshold for warn-level alerts.

Escalations.Warn.Times Integer No 3

The consecutive number of times for which the metric value exceeds the threshold for warn-level alerts before an alert is triggered.

Interval String No 60

The detection period of alerts.

NoEffectiveInterval String No 00:00-05:30

The period when the alert rule is ineffective.

Period String No 60

The aggregation period. Unite: second.

RuleName String No Alert rule 1

The name of the alert rule.

SilenceTime Integer No 86400

The duration of the mute period during which new alerts are not sent even if the trigger conditions are met. Unit: second. Default value: 86400. Minimum value: 3600.

Webhook String No http://www.aliyun.com

The URL of the callback triggered when an alert occurs.

Response parameters

Parameter Type Example Description 
Code String 200

The status code. A value of 200 indicates that the call is successful. A value other than 200 indicates that the call has failed.

Message String success

The error message.

RequestId String 461CF2CD-2FC3-4B26-8645-7BD27E7D0F1D

The request ID for troubleshooting.

Success Boolean true

Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.

Examples

Sample requests


http(s)://[Endpoint]/? Action=PutGroupMetricRule
&Category=ecs
&GroupId=123456
&MetricName=cpu_total
&Namespace=acs_ecs_dashboard 
&RuleId=bfae2ca5b4e07d2c7278772eccda169808c7b****
&<Common request parameters>

Successful response examples

XML format

<PutGroupMetricRuleResponse>
  <RequestId>26C766DE-E759-4B38-8B23-28589C491CEF</RequestId>
  <Code>200</Code>
  <Success>true</Success> 
</PutGroupMetricRuleResponse>

JSON format

{
	"RequestId":"26C766DE-E759-4B38-8B23-28589C491CEF",
	"Success":true,
	"Code":200
}

Error code

View error codes