Queries historical alerts.

This API operation is no longer maintained. We recommend that you call the DescribeAlertLogList operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeAlertHistoryList

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

RuleId String No applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5****

The ID of the alert rule.

For information about how to query the ID of an alert rule, see DescribeMetricRuleList.

RuleName String No ECS_Rule

The name of the alert rule.

For information about how to query the name of an alert rule, see DescribeMetricRuleList.

Namespace String No acs_ecs_dashboard

The namespace of the cloud service.

For information about how to query the namespace of a cloud service, see Appendix 1: Metrics.

MetricName String No cpu_total

The metric that is used to monitor the cloud service.

For information about how to query the name of a metric, see Appendix 1: Metrics.

GroupId String No 7671****

The ID of the application group.

For information about how to obtain the ID of an application group, see DescribeMonitorGroups.

Status String No 2

Specifies whether alerts are muted. Valid values:

  • 2 (default): Alerts are muted and are not triggered within the mute period, even if the condition specified in the alert rule is met.
  • 0: Alerts are triggered or cleared.
  • 1: The alert rule is ineffective.
State String No ALARM

The alert status. Valid values:

  • ALARM (default): Alerts are triggered.
  • OK: No alerts are triggered.
Ascending Boolean No true

The order of alerts. Valid values:

  • true (default): reverse chronological order
  • false: chronological order
StartTime String No 1640237400000

The start timestamp of the alert logs to be queried.

Unit: milliseconds.

EndTime String No 1640608200000

The end timestamp of the alert logs to be queried.

Unit: milliseconds.

PageSize Integer No 10

The number of entries to return on each page.

Default value: 10.

Page Integer No 1

The number of the page to return.

Default value: 1.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The status code 200 indicates that the request was successful.
Message String The Request is not authorization.

The returned message.

RequestId String C3C69FBE-2262-541F-A409-C52F380BAE63

The request ID.

Total String 2

The total number of returned entries.

Success Boolean true

Indicates whether the request was successful. Valid values:

  • true
  • false
AlarmHistoryList Array of AlarmHistory

The details of historical alerts.

AlarmHistory
Status Integer 2

Indicates whether alerts are muted. Valid values:

  • 2 (default): Alerts are muted and are not triggered within the mute period, even if the condition specified in the alert rule is met.
  • 0: Alerts are triggered or cleared.
  • 1: The alert rule is ineffective.
MetricName String cpu_total

The name of the metric.

EvaluationCount Integer 3

The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.

State String ALARM

The alert status. Valid values:

  • ALARM: Alerts are triggered.
  • OK: No alerts are triggered.
Namespace String acs_ecs_dashboard

The namespace of the cloud service.

Webhooks String https://www.aliyun.com

The callback URL.

RuleName String ECS_Rule

The name of the alert rule.

RuleId String applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5****

The ID of the alert rule.

LastTime Long 360133

The duration of the alert. Unit: milliseconds.

Value String 10.58

The threshold of the metric value to trigger or clear an alert.

Expression String $Average>=10

The expression that is used to trigger alerts.

GroupId String 7671****

The ID of the application group.

AlertTime Long 1640586600000

The timestamp when the alert was triggered. Unit: milliseconds.

InstanceName String i-bp1cqhiw1za2****

The name of the monitored instance.

Dimensions String {\"instanceId\":\"i-bp1cqhiw1za2****\"}

The resources that are monitored.

Level String P4

The severity level and notification methods of the alert. Valid values:

  • P4: Alert notifications are sent by using emails and DingTalk chatbots.
  • OK: No alert is generated.
Contacts Array of String Alice

The alert contacts that receive alert notifications.

ContactALIIMs Array of String username@example.com

The TradeManager IDs of the alert contacts.

Note This parameter is valid only on the China site (aliyun.com).
ContactMails Array of String username@example.com

The email addresses of the alert contacts.

ContactSmses Array of String 13900009999

The mobile numbers of the alert contacts.

Note This parameter is valid only on the China site (aliyun.com).
ContactGroups Array of String ECS_Group

The alert contact groups.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeAlertHistoryList
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeAlertHistoryListResponse>
	<AlarmHistoryList>
		<AlarmHistory>
			<Status>2</Status>
			<ContactGroups>
				<ContactGroup>ECS_Group</ContactGroup>
			</ContactGroups>
			<RuleId>applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5****</RuleId>
			<Dimensions>{\"instanceId\":\"i-bp1cqhiw1za2****\"}</Dimensions>
			<EvaluationCount>3</EvaluationCount>
			<ContactMails></ContactMails>
			<ContactSmses></ContactSmses>
			<Namespace>acs_ecs_dashboard</Namespace>
			<AlertTime>1640586600000</AlertTime>
			<GroupId>7671****</GroupId>
			<InstanceName>i-bp1cqhiw1za2****</InstanceName>
			<MetricName>cpu_total</MetricName>
			<Contacts></Contacts>
			<Expression>$Average>=10</Expression>
			<State>ALARM</State>
			<Value>10.58</Value>
			<Level>P4</Level>
			<PreLevel>P4</PreLevel>
			<LastTime>360133</LastTime>
			<RuleName>ECS_Rule</RuleName>
			<ContactALIIMs></ContactALIIMs>
		</AlarmHistory>
		<AlarmHistory>
			<Status>0</Status>
			<ContactGroups>
				<ContactGroup>ECS_Group</ContactGroup>
			</ContactGroups>
			<RuleId>applyTemplate61dc81b5-d357-4cf6-a9b7-9f83****</RuleId>
			<Dimensions>{\"instanceId\":\"i-bp1cqhiw1za2807s****\"}</Dimensions>
			<EvaluationCount>3</EvaluationCount>
			<ContactMails></ContactMails>
			<ContactSmses></ContactSmses>
			<Namespace>acs_ecs_dashboard</Namespace>
			<AlertTime>1640586540000</AlertTime>
			<GroupId>7671****</GroupId>
			<InstanceName>i-bp1cqhiw1za2807s****</InstanceName>
			<MetricName>cpu_total</MetricName>
			<Contacts></Contacts>
			<Expression>$Average>=10</Expression>
			<State>ALARM</State>
			<Value>10.13</Value>
			<Level>P4</Level>
			<LastTime>300085</LastTime>
			<RuleName>ECS_Rule</RuleName>
			<ContactALIIMs>
				<ContactALIIM>\"username@example.com\"</ContactALIIM>
			</ContactALIIMs>
		</AlarmHistory>
	</AlarmHistoryList>
	<RequestId>C3C69FBE-2262-541F-A409-C52F380BAE63</RequestId>
	<Total>2</Total>
	<Code>200</Code>
	<Success>true</Success>
</DescribeAlertHistoryListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "AlarmHistoryList" : {
    "AlarmHistory" : [ {
      "Status" : 2,
      "ContactGroups" : {
        "ContactGroup" : [ "ECS_Group" ]
      },
      "RuleId" : "applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5****",
      "Dimensions" : "{\"instanceId\":\"i-bp1cqhiw1za2****\"}",
      "EvaluationCount" : 3,
      "ContactMails" : {
        "ContactMail" : [ ]
      },
      "ContactSmses" : {
        "ContactSms" : [ ]
      },
      "Namespace" : "acs_ecs_dashboard",
      "AlertTime" : 1640586600000,
      "GroupId" : "7671****",
      "InstanceName" : "i-bp1cqhiw1za2****",
      "MetricName" : "cpu_total",
      "Contacts" : {
        "Contact" : [ ]
      },
      "Expression" : "$Average>=10",
      "State" : "ALARM",
      "Value" : "10.58",
      "Level" : "P4",
      "PreLevel" : "P4",
      "LastTime" : 360133,
      "RuleName" : "ECS_Rule",
      "ContactALIIMs" : {
        "ContactALIIM" : [ ]
      }
    }, {
      "Status" : 0,
      "ContactGroups" : {
        "ContactGroup" : [ "ECS_Group" ]
      },
      "RuleId" : "applyTemplate61dc81b5-d357-4cf6-a9b7-9f83****",
      "Dimensions" : "{\"instanceId\":\"i-bp1cqhiw1za2807s****\"}",
      "EvaluationCount" : 3,
      "ContactMails" : {
        "ContactMail" : [ ]
      },
      "ContactSmses" : {
        "ContactSms" : [ ]
      },
      "Namespace" : "acs_ecs_dashboard",
      "AlertTime" : 1640586540000,
      "GroupId" : "7671****",
      "InstanceName" : "i-bp1cqhiw1za2807s****",
      "MetricName" : "cpu_total",
      "Contacts" : {
        "Contact" : [ ]
      },
      "Expression" : "$Average>=10",
      "State" : "ALARM",
      "Value" : "10.13",
      "Level" : "P4",
      "LastTime" : 300085,
      "RuleName" : "ECS_Rule",
      "ContactALIIMs" : {
        "ContactALIIM" : [ "\"username@example.com\"" ]
      }
    } ]
  },
  "RequestId" : "C3C69FBE-2262-541F-A409-C52F380BAE63",
  "Total" : 2,
  "Code" : "200",
  "Success" : true
}

Error codes

For a list of error codes, see Service error codes.