Queries the alert history.

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

Name Type Required Example Description
Action String Yes DescribeAlertHistoryList

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

RuleId String No aaaabbb123

The ID of the alert rule.

RuleName String No My alert rule

The name of the alert rule.

Namespace String No acs_ecs_dashboard

The namespace of the monitored service.

Note For more information, see DescribeMetricMetaList or Preset metrics reference.
MetricName String No cpu_total

The name of the metric.

Note For more information, see DescribeMetricMetaList or Preset metrics reference.
GroupId String No 123456

The ID of the application group used to manage cloud resources.

Status String No Status

The status of the mute period. Valid values:

  • 2: indicates that alerts are muted and are not triggered within the period, even if the condition specified in the alert rule is met.
  • 0: indicates that alerts can be triggered.
State String No ALARM

The alert status. Valid values:

  • ALARM: indicates that alerts are triggered.
  • OK: indicates that no alerts are triggered.
Ascending Boolean No true

The order of alerts. Valid values:

  • true: indicates the reverse chronological order.
  • false: indicates the chronological order.

Default value: true.

StartTime String No 1554085998000

The start time of the query time range.

This value must be a Unix timestamp. The Unix timestamp is the number of seconds that have elapsed since the epoch (January 1, 1970, 00:00:00 UTC).

EndTime String No 1554085998000

The end time of the query time range.

This value must be a Unix timestamp. The Unix timestamp is the number of seconds that have elapsed since the epoch (January 1, 1970, 00:00:00 UTC).

PageSize Integer No 10

The number of entries on each page.

Page Integer No 1

The number of the page to return.

Response parameters

Parameter Type Example Description
RequestId String 189B35DD-68BA-43CE-A66A-57F0BE12C885

The ID of the request.

Code String 200

The HTTP status code.

Note The status code 200 indicates a successful request. Other status codes indicate a failed request.
Success Boolean true

Indicates whether the call was successful.

Total String 2

The total number of entries returned.

AlarmHistoryList Array

The alert history.

AlarmHistory
AlertTime Long 1554105040000

The time when an alert was triggered.

ContactALIIMs List My TradeManager

The TradeManager accounts that can receive alert notifications.

ContactGroups List The group of alert contacts

The contact groups that can receive alert notifications.

ContactMails List xxx@aliyun.com

The email addresses that can receive alert notifications.

ContactSmses List 1333333****

The list of mobile phone numbers that can receive SMS messages of alerts.

Contacts List My alert contacts

The contacts that can receive alert notifications.

Dimensions String {"instanceId":"i-2zebwilv3xfdg1****"}

The resources that are monitored.

EvaluationCount Integer 2

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

Expression String $Average>=1

The expression of the metric, which defines when an alert is triggered.

GroupId String 12345

The ID of the application group used to manage cloud resources.

InstanceName String ali-186xxxx123456

The name of the monitored instance.

LastTime Long 347020693

The time when the status last changed.

Level String P3

The level of the alert. Valid values:

  • P4: The alert notification is delivered through emails and DingTalk Chatbot.
MetricName String cpu_total

The name of the metric.

Note For more information, see DescribeMetricMetaList or Preset metrics reference.
Namespace String acs_ecs_dashboard

The namespace of the service.

Note For more information, see DescribeMetricMetaList or Preset metrics reference.
RuleId String d97a65a7-70d2-4a8a-97bf-1a9147****

The ID of the alert rule.

RuleName String My alert rule

The name of the alert rule.

State String ALARM

The alert status. Valid values:

  • ALARM: indicates that alerts are triggered.
  • OK: indicates that no alerts are triggered.
Status Integer 2

The status of the mute period. Valid values:

  • 2: indicates that alerts are muted and are not triggered within the period, even if the condition specified in the alert rule is met.
  • 0: indicates that alerts can be triggered.
Value String 5.39

The threshold of the metric value for an alert to be triggered.

Webhooks String http://www.aliyun.com/webhook.html

The webhook address.

Message String success

The error message.

Examples

Sample requests

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

Sample success responses

XML format

<AlarmHistoryList>
    <AlarmHistory>
        <Value>4.41</Value>
        <LastTime>881140083</LastTime>
        <Webhooks/>
        <ContactSmses>
        </ContactSmses>
        <RuleName>test-auto-scaling-0001</RuleName>
        <GroupId/>
        <AlertName>putNewAlarm_xxxxxx</AlertName>
        <EvaluationCount>1</EvaluationCount>
        <Status>2</Status>
        <AlertState>ALARM</AlertState>
        <MetricName>cpu_total#60</MetricName>
        <ContactMails>
        </ContactMails>
        <AlertTime>1554986620000</AlertTime>
        <Dimensions>{"instanceId":"i-2******3"}</Dimensions>
        <RuleId/>
        <Contacts>
        </Contacts>
        <Namespace>acs_ecs</Namespace>
        <ContactALIIMs>
        </ContactALIIMs>
        <ContactGroups>
        </ContactGroups>
        <Expression>$Average&gt;=1</Expression>
        <Level>P3</Level>
        <InstanceName/>
    </AlarmHistory>
    <AlarmHistory>
        <Value>2.13</Value>
        <LastTime>760058</LastTime>
        <Webhooks/>
        <ContactSmses>
        </ContactSmses>
        <RuleName>test-auto-scaling-0001</RuleName>
        <GroupId/>
        <AlertName>putNewAlarm_us****</AlertName>
        <EvaluationCount>1</EvaluationCount>
        <Status>2</Status>
        <AlertState>ALARM</AlertState>
        <MetricName>cpu_total#60</MetricName>
        <ContactMails>
        </ContactMails>
        <AlertTime>1554986620000</AlertTime>
        <Dimensions>{"instanceId":"i-2z*****"}</Dimensions>
        <RuleId/>
        <Contacts>
        </Contacts>
        <Namespace>acs_ecs</Namespace>
        <ContactALIIMs>
        </ContactALIIMs>
        <ContactGroups>
        </ContactGroups>
        <Expression>$Average&gt;=1</Expression>
        <Level>P3</Level>
        <InstanceName/>
    </AlarmHistory>
</AlarmHistoryList>
<RequestId>FEBE3561-166F-4DB2-BB59-020B26F30318</RequestId>
<Success>true</Success>
<Code>200</Code>
<Total>102390</Total>

JSON format

{
  "AlarmHistoryList": {
    "AlarmHistory": [
      {
        "Value": "4.41",
        "LastTime": 881140083,
        "Webhooks": "",
        "ContactSmses": {
          "ContactSms": []
        },
        "RuleName": "test-auto-scaling-0001",
        "GroupId": "",
        "AlertName": "putNewAlarm_xxxxxx",
        "EvaluationCount": 1,
        "Status": 2,
        "AlertState": "ALARM",
        "MetricName": "cpu_total#60",
        "ContactMails": {
          "ContactMail": []
        },
        "AlertTime": 1554986620000,
        "Dimensions": "{\"instanceId\":\"i-2******3\"}",
        "RuleId": "",
        "Contacts": {
          "Contact": []
        },
        "Namespace": "acs_ecs",
        "ContactALIIMs": {
          "ContactALIIM": []
        },
        "ContactGroups": {
          "ContactGroup": []
        },
        "Expression": "$Average>=1",
        "Level": "P3",
        "InstanceName": ""
      },
      {
        "Value": "2.13",
        "LastTime": 760058,
        "Webhooks": "",
        "ContactSmses": {
          "ContactSms": []
        },
        "RuleName": "test-auto-scaling-0001",
        "GroupId": "",
        "AlertName": "putNewAlarm_us****",
        "EvaluationCount": 1,
        "Status": 2,
        "AlertState": "ALARM",
        "MetricName": "cpu_total#60",
        "ContactMails": {
          "ContactMail": []
        },
        "AlertTime": 1554986620000,
        "Dimensions": "{\"instanceId\":\"i-2z*****\"}",
        "RuleId": "",
        "Contacts": {
          "Contact": []
        },
        "Namespace": "acs_ecs",
        "ContactALIIMs": {
          "ContactALIIM": []
        },
        "ContactGroups": {
          "ContactGroup": []
        },
        "Expression": "$Average>=1",
        "Level": "P3",
        "InstanceName": ""
      }
    ]
  },
  "RequestId": "FEBE3561-166F-4DB2-BB59-020B26F30318",
  "Success": true,
  "Code": "200",
  "Total": 102390
}

Error codes

For a list of error codes, visit the API Error Center.