Alarm history
Last Updated:2025-11-14
Alarm History List
Request structure
- method:POST
- URL:/ah-api/v1/alarmhouse/alarm/list
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | RequestBody |
| alarmType | String | Alarm type, required, options: ALARM_TYPE_CLOUD (Cloud Product Monitor) ALARM_TYPE_SITE (Site Monitor) ALARM_TYPE_CUSTOM (Custom Monitor) ALARM_TYPE_APP (Application Monitor) |
Yes | RequestBody |
| pageNo | Int | Page number, starting from 1, required | Yes | RequestBody |
| pageSize | Int | Number of items per page, required, maximum: 100 | Yes | RequestBody |
| startTime | Int | Start time, Unix Timestamp, unit: millisecond, optional; default to 40 days ago if not set | No | RequestBody |
| endTime | Int | End time, Unix Timestamp, unit: millisecond, optional; default to the current time if not set | No | RequestBody |
| scope | String | Cloud product, optional; return alarms for all cloud products if not set | No | RequestBody |
| resourceType | String | Monitor object type, optional; return alarms for all monitor object types if not set | No | RequestBody |
| states | List<String> | Alarm status, optional. Multiple statuses can be filtered simultaneously. Return alarms for all statuses if not set. Options: OK (Recovery) ALERT (Abnormal) INSUFFICIENT_DATA (Insufficient Data) CLOSED (Closed) |
No | RequestBody |
| sort | String | Sort field, optional. Default to startTime if not set. Options: startTime |
No | RequestBody |
| ascending | Boolean | Is it in ascending order? Optional, it is false by default. | No | RequestBody |
| level | String | Alarm level, optional. Return alarms for all levels if not set. Options: ALARM_LEVEL_NOTICE (Notice) ALARM_LEVEL_WARNING (Warning) ALARM_LEVEL_MAJOR (Major) ALARM_LEVEL_CRITICAL (Critical) |
No | RequestBody |
| region | String | Region, optional. Return alarms for all Regions if not set | No | RequestBody |
| alarmAliasName | String | Fuzzy query by strategy name, optional | No | RequestBody |
| resource | ResourceKV | Search by Instance, optional | No | RequestBody |
| resources | List<ResourceKV> | Search by multiple Instances, optional | No | RequestBody |
ResourceKV
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| InstanceId | String | Instance ID, optional | No | RequestBody |
| taskId | String | Site Monitor Task ID, specify the Site Monitor task by filling in taskId | No | RequestBody |
Response parameters
| Name | Types | Description |
|---|---|---|
| success | Boolean | Whether the request succeeded |
| msg | String | If failed, return the reason for failure |
| result | PageResult | Paginated results |
PageResult
| Name | Types | Description |
|---|---|---|
| alarms | List<Alarm> | Alarm History List |
| pageNo | Int | Page number |
| pageSize | Int | Page size |
| totalCount | Int | Total number of Alarm History records |
Request example
POST /ah-api/v1/alarmhouse/alarm/list
{
"userId": "453bf9********************9090dc",
"startTime": 1722319915374,
"endTime": 1722924715374,
"alarmType": "ALARM_TYPE_CLOUD",
"scope": "BCE_BCC",
"resourceType": "Instance",
"states": ["OK"],
"sort": "startTime",
"ascending": false,
"level": "ALARM_LEVEL_NOTICE",
"region": "bj",
alarmAliasName: Test strategy,
"resource": {
"InstanceId": "i-12*****7",
"taskId": "yotKl***************MBsNgSmBZ",
},
"resources": [
{"InstanceId": "i-12*****7"},
{"InstanceId": "i-83*****e"},
],
"pageNo": 1,
"pageSize": 10,
}
// Response
{
"success": true,
"msg": "",
"result": {
"alarms": [
{
"id": "f54c9563fe32**********680d381f9f68931",
"userId": "453bf9********************9090dc",
"seriesId": "ab910517974c*********79e79f46200f25cb",
"startTime": 1722924659999,
"endTime": 1722924719999,
"state": "ALERT",
"closeReason": "INSUFFICIENT_DATA",
"policy": {
"name": "919ad2628dad**********85f4132ad9e",
"aliasName": "eip-all-test",
"updateTime": 1722425024000,
content: 1-minute average Internet ingress traffic > 100 Bytes, 1 consecutive occurrence,
"contentEn": "The average internet input traffic > 100Bytes, ocurring once in a row",
"level": "ALARM_LEVEL_MAJOR",
"checkPeriod": 60
}
"resource": {
"scope": "BCE_BCC",
"resourceType": "Instance",
"region": "bj",
"identifiers": {
"InstanceId": "ip-12*****7",
},
"properties": {
"application": "bcc",
"internalIp": "192.168.16.10",
"shortInstanceId": "i-I8*****J"
}
}
"actions": [
{
"type": "ACTION_TYPE_OK",
"name": "test_action",
"executedTime": 1722924721,
alias: Default action
"notifications": [
"EMAIL",
"SMS",
"PHONE"
],
"callBacks": [
"http://apiin.im.baidu.com/api/msg/xxxxx"
],
"members": [
"zsli",
"test_user"
]
}
]
}
]
"pageNo": 1,
"pageSize": 10,
"totalCount": 12345,
}
}Alarm History details
Request structure
- method:GET
- URL:/ah-api/v1/alarmhouse/alarm?alarmId=${alarmId}&userId=${userId}
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | User ID | Yes | Path |
| alarmId | String | Alarm ID, globally unique, obtain from the Alarm History List API | Yes | Path |
Response parameters
| Name | Types | Description |
|---|---|---|
| success | Boolean | Whether the request succeeded |
| msg | String | If failed, return the reason for failure |
| result | Alarm | Alarm detail content |
Request example
GET ah-api/v1/alarmhouse/alarm?
alarmId=f54c9563fe32**********680d381f9f68931&
userId=453bf9********************9090dc
// Response
{
"success": true,
"msg": "",
"result": {
"id": "f54c9563fe32**********680d381f9f68931",
"userId": "453bf9********************9090dc",
"seriesId": "ab910517974c*********79e79f46200f25cb",
"startTime": 1659534994121,
"endTime": 0,
"initState": "ALERT",
"state": "ALERT",
"closeReason": "INSUFFICIENT_DATA",
"policy": {
"name": "919ad2628dad42f78280c85f4132ad9e",
"aliasName": "eip-all-test",
"updateTime": 1722425024000,
content: 1-minute average Internet ingress traffic > 100 Bytes, 1 consecutive occurrence,
"contentEn": "The average internet input traffic > 100Bytes, ocurring once in a row",
"level": "ALARM_LEVEL_MAJOR",
"checkPeriod": 60,
},
"resource": {
"scope": "BCE_BCC",
"resourceType": "Instance",
"region": "bj",
"identifiers": {
"instanceId": "ip-12*****7",
}
},
"actions": [
{
"type": "ACTION_TYPE_OK",
"name": "test_action",
"executedTime": 1659534994121,
"notifications" : [
"EMAIL",
"SMS",
"PHONE"
],
"callBacks" : [
"http://apiin.im.baidu.com/api/msg/xxxxx"
],
"members" : [
"zxj",
"test_user"
]
}
],
"alertMetrics": [
{
"metric": {
"name": "CpuUsage",
"value": 50,
"dimensions": {
"dimension_key": "dimension_value"
},
aliasName: 1-minute average CPU usage,
"aliasNameEn": "1 min average of cpu usage",
"unit": "%",
},
"rule": {
"seq": 0,
"operator": "OPERATOR_TYPE_LE",
"threshold": 10,
"statistics": "STATISTICS_TYPE_AVG",
"window": 60
}
}
]
}
}Appendix
Alarm
| Name | Types | Description |
|---|---|---|
| id | String | Alarm ID, globally unique |
| seriesId | String | User ID |
| userId | String | Alarm sequence ID |
| initState | String | Initial alarm status, possible values: OK (Recovery) ALERT (Abnormal) INSUFFICIENT_DATA (Insufficient Data) CLOSED (Closed) |
| state | String | Current status; an alarm can have up to two statuses. If current status = initial status, the alarm remains in its initial status |
| closeReason | String | If the alarm is closed, this field indicates the reason for closure, possible values: INSUFFICIENT_DATA (No Data) POLICY_MODIFIED (Policy Modified or Deleted) |
| startTime | Int | Alarm start time, Unix Timestamp, unit: millisecond |
| endTime | Int | Alarm end time, Unix Timestamp, unit: millisecond; if the alarm hasn't ended, fill this field with 0 |
| resource | Resource | Resources associated with the alarm |
| policy | Policy | Alarm Strategy corresponding to the alarm |
| actions | List<Action> | Alarm action list |
| alertMetrics | List<AlertMetrics> | Metric information that triggered the alarm, returned when querying historical details |
Resource
| Name | Types | Description |
|---|---|---|
| scope | String | Associated cloud product |
| resourceType | String | Cloud product sub-resource type |
| region | String | Region |
| identifiers | Map<String, String> | Resource identifier. Different cloud products have different identifiers |
| properties | Map<String, String> | Resource attributes. Different cloud products have different resource attributes |
Policy
| Name | Types | Description |
|---|---|---|
| name | String | Strategy name, used to query strategy details |
| aliasName | String | Strategy display name |
| content | String | Strategy content |
| contentEn | String | English strategy content |
| extra | Map<String, String> | Additional attributes of the Alarm Strategy, which will be returned if present |
Action
| Name | Types | Description |
|---|---|---|
| type | String | Action types, options: ACTION_TYPE_OK (Recovery notification) ACTION_TYPE_ALERT (Anomaly notification) ACTION_TYPE_INSUFFICIENT_DATA (Insufficient data notification) ACTION_TYPE_CALLBACK (Alarm callback) |
| name | String | Action name, when type=ACTION_TYPE_CALLBACK, this field should be filled with the callback address |
| executedTime | Int | Action execution time, Unix Timestamp, unit: millisecond. If this field is 0 or not set, the action has not been executed |
| alias | String | Name of notification template |
| notifications | List<String> | Notification methods, including only three: email, SMS, phone |
| callBacks | List<String> | Alarm callback URL |
| members | List<String> | User/Group information |
AlertMetrics
| Name | Types | Description |
|---|---|---|
| metric | Metric | Metric information that triggered the alarm |
| rule | Rule | Rules for triggering metric alarms |
Metric
| Name | Types | Description |
|---|---|---|
| name | String | Metric name |
| value | Int | Metric value when the alarm is triggered |
| dimensions | Map<String,String> | Metric dimension |
| aliasName | String | Metric name in Chinese |
| aliasNameEn | String | Metric name in English |
| unit | String | Metric unit |
Rule
| Name | Types | Description |
|---|---|---|
| seq | Int | In the Alarm Strategy rules, sequences with the same seq value indicate they belong to the same rule |
| operator | String | Comparison methods, possible values: OPER_TYPE_GT(greater than) OPER_TYPE_GE(greater than or equal) OPER_TYPE_LT(less than) OPER_TYPE_LE(less than or equal) OPER_TYPE_EQ(equal) OPER_TYPE_NE(not equal) MoM increase: OPER_TYPE_INC_RATE_GT(MoM increase rate greater than) OPER_TYPE_INC_RATE_GE(MoM increase rate greater than or equal) OPER_TYPE_INC_RATE_LT(MoM increase rate less than) OPER_TYPE_INC_RATE_LE(MoM increase rate less than or equal) OPER_TYPE_INC_RATE_EQ(MoM increase rate equal) OPER_TYPE_INC_RATE_NE(MoM increase rate not equal) MoM decrease: OPER_TYPE_DEC_RATE_GT(MoM decrease rate greater than) OPER_TYPE_DEC_RATE_GE(MoM decrease rate greater than or equal) OPER_TYPE_DEC_RATE_LT(MoM decrease rate less than) OPER_TYPE_DEC_RATE_LE(MoM decrease rate less than or equal) OPER_TYPE_DEC_RATE_EQ(MoM decrease rate equal) OPER_TYPE_DEC_RATE_NE(MoM decrease rate not equal) |
| threshold | Int | Alarm threshold |
