ListAlarmExecutionStats
Updated at:2025-11-03
Description
Retrieve alarm execution statistics
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 |
| policyName | String | No | RequestBody | Filter by policy name |
| logStoreName | String | No | RequestBody | Filter by logstore |
| 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, totalCount: Execution count, failCount: Failed execution count, noticeTotalCount: Notification count, noticeFailCount: Failed notification count |
| 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 |
|---|---|---|
| executionStats | List<executionStats> | Alarm Strategy List |
| pageNo | Int | Page number |
| pageSize | Int | Number of items per page |
| totalCount | Int | Total |
Each ExecutionStats element structure in the executionStats array is as follows:
| Parameter name | Types | Description |
|---|---|---|
| policyId | String | Alarm policy ID |
| policyName | String | Alarm strategy name |
| objects | List<LogStore> | Monitor Object |
| pendingCount | Int | Continuous trigger threshold, number of consecutive times the threshold is triggered before an alarm is raised |
| repeatIntervalMinute | Int | Repeat alarm interval, unit: minutes, default value: 0, which means repeat alarm is disabled |
| notices | List<Notice> | Alarm notification template, reference: BCM Notification Template API |
| totalCount | Int | Execution count |
| failCount | Int | Failed execution count |
| noticeTotalCount | Int | Notification count |
| noticeFailCount | Int | Failed notification count |
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 |
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 |
| disableTimes | List<Map<String, String>> | Muting period |
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 statistics list
10 "executionStats": [
11 {
12 "policyId": "x-aaaa", // Policy ID
13 "policyName": "test", // Policy name
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 // Continuous trigger threshold, number of consecutive times the threshold is triggered before an alarm is raised
24 "pendingCount": 1,
25 // Repeat alarm interval, unit: minutes, default value: 0, which means repeat alarm is disabled
26 "repeatIntervalMinute": 5,
27 // Notification list
28 "notices": [
29 {
30 "id": "dfa4298f-75e2-4e17-89f6-d41ea98ea196", // Template ID
31 "name": "Default notification", // Template name
32 // User list
33 "members": ["testUsername"],
34 // Notification method, options:
35 // EMAIL - Email
36 // SMS - SMS
37 // PHONE - Phone
38 "methods": ["EMAIL", "SMS", "PHONE"],
39 "callbacks": ["http://callback"], // Callback URL list
40 // Muting period
41 "disableTimes": [
42 {
43 // Start time
44 "from": "00:00:00",
45 // End time
46 "to": "00:00:00"
47 }
48 ]
49 }
50 ],
51 // Execution count
52 "totalCount": 10,
53 // Failed execution count
54 "failCount": 1,
55 // Notification count
56 "noticeTotalCount": 5,
57 // Failed notification count
58 "noticeFailCount": 1
59 }
60 ],
61 "pageNo": 1, // Page number
62 "pageSize": 10, // Number of items per page
63 "totalCount": 100, // Total count
64 }
65}
