Queries historical alerts.

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 obtain 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 value): 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 status of the alert. Valid values:

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

The order of alerts. Valid values:

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

The start timestamp of the historical alerts that you want to query.

Unit: milliseconds.

EndTime String No 1640608200000

The end timestamp of the historical alerts that you want to query.

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
RequestId String C3C69FBE-2262-541F-A409-C52F380BAE63

The ID of the request.

Code String 200

The HTTP status code.

Note The status code 200 indicates that the call is successful.
Success Boolean true

Indicates whether the call is successful. Valid values:

  • true: The call is successful.
  • false: The call fails.
Total String 2

The total number of returned entries.

AlarmHistoryList Array of AlarmHistory

The details of historical alerts.

AlarmHistory
AlertTime Long 1640586600000

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

ContactALIIMs List username@example.com

The TradeManager IDs of the alert contacts.

Note This parameter can be returned only on the China site (aliyun.com).
ContactGroups List ECS_Group

The alert contact groups.

ContactMails List username@example.com

The email addresses of the alert contacts.

ContactSmses List 13900009999

The mobile numbers of the alert contacts.

Note This parameter can be returned only on the China site (aliyun.com).
Contacts List Alice

The alert contacts that receive alert notifications.

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

The resources that are monitored.

EvaluationCount Integer 3

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

Expression String $Average>=10

The expression that is used to trigger alerts.

GroupId String 7671****

The ID of the application group.

InstanceName String i-bp1cqhiw1za2****

The name of the monitored instance.

LastTime Long 360133

The duration of the alert. Unit: milliseconds.

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.
MetricName String cpu_total

The name of the metric.

Namespace String acs_ecs_dashboard

The namespace of the cloud service.

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

The ID of the alert rule.

RuleName String ECS_Rule

The name of the alert rule.

State String ALARM

The status of the alert. Valid values:

  • ALARM: Alerts are triggered.
  • OK: No alerts are triggered.
Status Integer 2

Indicates whether alerts are muted. Valid values:

  • 2 (default value): 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.
Value String 10.58

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

Webhooks String https://www.aliyun.com

The callback URL.

Message String The Request is not authorization.

The error message.

Examples

Sample requests

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

Sample success responses

XML format

<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&gt;=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&gt;=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

{
    "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, visit the API Error Center.