listLogAlarm
Updated at:2025-11-03
Description
View alert tasks that meet the query conditions.
Request
- Request syntax
Http
1GET /v1/alarm?alarmID={}&alarmName={}&project={}&logStoreName={}&destType={}&status={}&orderBy={}&order={}&pageNo={}&pageSize={} HTTP/1.1
2Host: bls-log.{region}.baidubce.com
3Authorization: authorization string
- Request headers
No additional headers are required beyond the standard request headers.
- Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| alarmName | String | no | query | Alert policy name; if filled, execute fuzzy search |
| alarmID | String | no | query | Alert policy ID; if filled, execute fuzzy search |
| project | String | no | query | Project name; if filled, exactly match the project and return the corresponding alert policy list |
| logStoreName | String | no | query | Logstore name; if filled, it will perform a fuzzy match on the LogStore and return the corresponding alert policy list |
| status | String | no | query | Filter by alert task status; options: Running, Running (Abnormal), Paused |
| orderBy | String | no | query | Sort order; now only support createDateTime; default: createDateTime |
| order | String | no | query | Options: asc/desc; default: desc |
| pageNo | Int | no | query | Page, starting from the default 1 |
| pageSize | int | no | query | Pagination size, range: [10, 100], default:10 |
Response
- Response headers
No additional headers are required beyond the standard response headers.
- Response parameters
| Parameter name | Types | Description |
|---|---|---|
| alarmResult | LIST[Alarm] | Alert list |
| count | int | Return the alert policy count |
Alarm structure:
| Parameter name | Types | Description |
|---|---|---|
| id | String | Alert policy ID |
| alarmName | String | Alert policy name |
| status | String | Alert policy running status |
| createDateTime | String | Creation time |
| project | String | Project name monitored by alert policy |
| logStoreName | String | LogStore name monitored by alert policy |
| alarmConfig | alarmConfig | Alert configuration |
| tags | LIST[Tag] | Tag |
AlarmConfig structure:
| Parameter name | Types | Description |
|---|---|---|
| alarmQuery | String | Query statement |
| alarmTimeRange | Int | Query statement time range, in minutes |
| frequency | Int | Push metric period, unit: minutes |
| metric | Metric | Push metric information |
Metric structure:
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| metricName | String | yes | body | Push metric name, 3-50 characters, including letters, digits, - and _ |
| dimensions | LIST[Dimension] | no | body | Dimension Information |
Dimension structure:
| Parameter name | Types | Description |
|---|---|---|
| name | string | Dimension name, consisting of 50 characters at most, including letters, digits, hyphens and underscores |
Tag structure:
| Parameter name | Types | Description |
|---|---|---|
| tagKey | string | Tag key name |
| tagValue | string | Tag value |
Example
- Request example
Http
1GET /v1/alarm 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 "alarmName":"alarm1",
7 "status":"Paused",
8 "orderBy":"createDateTime",
9 "order":"desc",
10 "pageNo":1,
11 "pageSize":50
12}
- Response example
Http
1HTTP/1.1 200
2Content-Type: application/json; charset=utf-8
3{
4 "count": 1,
5 "alarmResult": [{
6 "id": "a-123",
7 "alarmName": "alarm1",
8 "status": "Paused",
9 "createDateTime": "2023-07-18 11:34:54 +0000 UTC",
10 "project": "default",
11 "logStoreName": "storeAlarm",
12 "alarmConfig": {
13 "alarmQuery": "select count(error) as errCount, error group by error",
14 "alarmTimeRange": 10,
15 "frequency": 10,
16 "metric": {
17 "metricName": "errCount",
18 "dimensions": [
19 "name": "error",
20 }]
21 }
22 },
23 "tags": [{
24 "tagKey": "key",
25 "tagValue": "value"
26 }]
27 }]
28}
