ListAlarmExecutions
Updated at:2025-11-03
Description
Get alarm execution list
Request
- Request syntax
Text
1POST /v1/alarm/execution/list HTTP/1.1
2Host: <Endpoint>
3Authorization: <Authorization String>
4Content-Type: application/json; charset=utf-8
5{
6 "policyId": "<policyId>"
7}
- Request headers
No additional headers are required beyond the standard request headers.
- Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| policyId | String | No | RequestBody | Filter by policy ID |
| logStoreName | String | No | RequestBody | Filter by logstore |
| state | String | No | RequestBody | Filter by alarm status, values: OK: Recovered, ALERT: Alarming, CLOSED: Disabled |
| noticeStates | List<String> | No | RequestBody | Filter by alarm notification status, values: SENT: Sent, NOT_SENT: Not sent, FAIL: Failed to send, BLOCK_BY_PENDING_COUNT: Not sent due to insufficient frequency, BLOCK_BY_REPEAT_INTERVAL: Not sent due to repeat alarm interval not reached, BLOCK_BY_FREQUENCY: Not sent due to excessive sending attempts, BLOCK_BY_NOTICE_DISABLED: Not sent due to notifications being disabled |
| startDateTime | String | No | RequestBody | Query start time, UTC time, default value: 30 days ago |
| endDateTime | String | No | RequestBody | Query end time, UTC time, default value: current time |
| orderBy | String | No | RequestBody | Sorting field, @timestamp: Execution time, default value: @timestamp |
| order | String | No | RequestBody | Sorting method, asc: Ascending order, desc: Descending order, default value: desc |
| pageNo | Int | Yes | RequestBody | Page number, starting from 1 |
| pageSize | Int | Yes | RequestBody | Number of items per page, maximum: 100 |
Response
- Response headers
No additional headers are required beyond the standard response headers.
- Response parameters
| Field | Types | Description |
|---|---|---|
| success | Boolean | Whether the request succeeded |
| code | String | Request code, OK for success, or a specific error code for failure |
| message | String | Empty for request success, or a specific error message for request failure |
| result | Result | Alarm record details |
The element structure of result object is as follows:
| Field | Types | Description |
|---|---|---|
| executions | List<Execution> | Alarm Strategy List |
| pageNo | Int | Page number |
| pageSize | Int | Number of items per page |
| totalCount | Int | Total |
Each Execution element structure in the executions array is as follows:
| Parameter name | Types | Description |
|---|---|---|
| time | String | Execution time, UTC time |
| objects | List<LogStore> | Monitor Object |
| state | String | Execution status, values: OK: Return to normal, ALERT: Alarming |
| noticeState | String | Notification status, values: SENT: Sent, NOT_SENT: Not sent, FAIL: Failed to send, BLOCK_BY_PENDING_COUNT: Not sent due to insufficient frequency, BLOCK_BY_REPEAT_INTERVAL: Not sent due to repeat alarm interval not reached, BLOCK_BY_FREQUENCY: Not sent due to excessive sending attempts, BLOCK_BY_NOTICE_DISABLED: Not sent due to notifications being disabled |
| reason | String | If sending failed, fill in the failure reason |
| triggerConditions | List<TriggerCondition> | List of trigger conditions |
| groups | List<Map<String, Any>> | Group trigger |
| values | Map<String, Any> | Query result data when the alarm is triggered |
| notices | List<Notice> | Alarm notification template, reference: BCM Notification Template API |
| rawLogs | List<RawLog> | Original logs in alarm notification |
Each LogStore element structure in the objects array is as follows:
| Field | Types | Description |
|---|---|---|
| project | String | Logstore project, defaulting to "default" |
| logStoreName | String | Logstore name |
| logStoreId | String | Monitor Object ID |
Each TriggerCondition element structure in the triggerConditions array is as follows:
| Parameter name | Types | Description |
|---|---|---|
| level | String | Alarm level, required. Options: INFO, WARN, and CRITICAL |
| condition | String | Trigger condition expression |
Notice element structure is as follows:
| Parameter name | Types | Description |
|---|---|---|
| id | String | Alarm template ID |
| name | String | Alarm template name |
| members | List<String> | Alarm template user list |
| methods | List<String> | Alarm template notification method, values: EMAIL: Email, SMS: SMS, PHONE: Telephone |
| callbacks | List<String> | Alarm template callback address |
RawLog element structure is as follows:
| Parameter name | Types | Description |
|---|---|---|
| project | String | Logstore project |
| logStoreName | String | Logstore name |
| query | String | Query statement |
| columns | List<String> | Specified display fields |
| limit | Int | Number of displayed logs |
| logs | List<Map<String, Any>> | Displayed log content |
Error code
No special error codes are returned beyond standard error codes.
Example
- Request example
Text
1POST /v1/alarm/execution/list HTTP/1.1
2Host: bls-log.bj.baidubce.com
3Authorization:bce-auth-v1/18717522d39411e9b721df098b0b908c/2019-09-10T07:00:20Z/1800/content-type;host;x-bce-date;x-bce-request-id/6a7cb6c9ac7ec156c805e55e7d0bcfc443b47feee97cf099c1c0d93a0b4c8304
4Content-Type: application/json; charset=utf-8
5{
6 "pageNo": 1,
7 "pageSize": 10
8}
- Response example
Text
1HTTP/1.1 201
2Content-Type: application/json; charset=utf-8
3X-Bce-Request-Id: 2eeba101-4cc7-4cfe-b5ac-a3be8d060e33
4Date: Fri, 10 Apr 2020 04:42:37 GMT
5{
6 "success": true,
7 "msg": "", // If failed, return the failure reason
8 result: {
9 // Execution list
10 "executions": [
11 {
12 "time": "2024-04-10T10:12:30Z", // Execution time
13
14 // Monitor object
15 "objects": [
16 {
17 // Monitor object ID
18 "logStoreId": "l-P8QD16AB",
19 // Monitor object name
20 "logStoreName": "wang_test"
21 }
22 ],
23
24 // Execution status, options:
25 // ALERT - Alert
26 // OK - Restore to normal, optional
27 // FAIL - Execution failed
28 "state": "ALERT",
29
30 // Notification status, options:
31 // SENT - Sent,
32 // NOT_SENT - Not sent
33 // FAIL - Failed
34 // BLOCK_BY_PENDING_COUNT - Not sent due to insufficient frequency
35 // BLOCK_BY_REPEAT_INTERVAL - Not sent due to repeat alarm interval not reached
36 // BLOCK_BY_FREQUENCY - Not sent due to excessive sending attempts
37 // BLOCK_BY_NOTICE_DISABLED - Not sent due to notifications being disabled
38 "noticeState": "SENT",
39 "reason": "", // If sending failed, fill in the failure reason
40
41 // Associated trigger conditions
42 "triggerCondition": {
43 // Alarm level, options:
44 // INFO - Notification,
45 // WARN - Warning
46 // CRITICAL - Critical
47 "level": "WARN",
48
49 // Trigger condition expression
50 "condition": "$1.age > 1"
51 },
52
53 // Group results
54 "groups": [
55 {"key": "$1.prov", "value": "bj"},
56 ],
57
58 // Query result data when the alarm is triggered
59 "values": [
60 {"key": "$1.prov", "value": "bj"},
61 {"key": "$1.pv", "value": 1000},
62 ],
63
64 "notices": [
65 {
66 "id": "dfa4298f-75e2-4e17-89f6-d41ea98ea196", // Template ID
67 "name": "Default notification", // Template name
68 // User list
69 "members": ["testUsername"],
70 // Notification method, options:
71 // EMAIL - Email
72 // SMS - SMS
73 // PHONE - Phone
74 "methods": ["EMAIL", "SMS", "PHONE"],
75 "callbacks": ["http://callback"], // Callback URL list
76 // Muting period
77 "disableTimes": [
78 {
79 // Start time
80 "from": "00:00:00",
81 // End time
82 "to": "00:00:00"
83 }
84 ]
85 }
86 ]
87 }
88 ],
89 "pageNo": 1, // Page number
90 "pageSize": 10, // Number of items per page
91 "totalCount": 100, // Total count
92 }
93}
