getLogAlarm
Updated at:2025-11-03
Description
View specified alert tasks.
Request
- Request syntax
Http
1GET /v1/alarm/{alarmID} 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 |
|---|---|---|---|---|
| alarmID | String | yes | path | Alert policy ID |
Response
- Response headers
No additional headers are required beyond the standard response headers.
- Response parameters
| 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
1POST /v1/alarm/{alarm-1-1} 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
- Response example
Http
1HTTP/1.1 200
2Content-Type: application/json; charset=utf-8
3{
4 "id": "a-123",
5 "alarmName": "alarm1",
6 "status": "Paused",
7 "createDateTime": "2023-07-18 11:34:54 +0000 UTC",
8 "project": "default",
9 "logStoreName": "storeAlarm",
10 "alarmConfig": {
11 "alarmQuery": "select count(error) as errCount, error group by error",
12 "alarmTimeRange": 10,
13 "frequency": 10,
14 "metric": {
15 "metricName": "errCount",
16 "dimensions": [{
17 "name": "error",
18 }]
19 }
20 },
21 "tags": [{
22 "tagKey": "key",
23 "tagValue": "value"
24 }]
25}
