查询报警模版列表
更新时间:2026-06-26
查询报警模板列表
分页查询报警模板列表,支持按名称、云产品类型等条件筛选。
API Explorer
去调试
您可以在 API Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,API Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1POST /v3/bcm?action=DescribeAlarmTemplates HTTP/1.1
2Host: bcm.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "name": "bcc_temp",
7 "scope": "BCE_BCC",
8 "resourceType": "Instance",
9 "subResourceType": "",
10 "order": "desc",
11 "orderBy": "name",
12 "pageNo": 1,
13 "pageSize": 10
14}
请求头域
除公共头域外,无其他特殊头域
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号,当前取值为v3 |
| name | String | 否 | RequestBody参数 | 模板名称,支持模糊匹配 |
| scope | String | 否 | RequestBody参数 | 云产品类型 |
| resourceType | String | 否 | RequestBody参数 | 资源类型 |
| subResourceType | String | 否 | RequestBody参数 | 子资源类型 |
| order | String | 否 | RequestBody参数 | 排序方向,asc/desc |
| orderBy | String | 否 | RequestBody参数 | 排序字段 |
| pageNo | Integer | 是 | RequestBody参数 | 页码,从1开始 |
| pageSize | Integer | 是 | RequestBody参数 | 每页条数 |
返回状态码
成功返回200,失败返回见错误码
返回头域
除公共头域外,无其他特殊头域
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| success | Boolean | 请求是否成功 |
| code | String | 响应码 |
| message | String | 错误信息 |
| pageNo | Integer | 当前页码 |
| pageSize | Integer | 每页条数 |
| totalCount | Integer | 总记录数 |
| alarmTemplates | List<AlarmTemplate> | 报警模板列表 |
| alarmTemplates.id | String | 报警模板ID |
| alarmTemplates.scope | String | 云产品类型 |
| alarmTemplates.resourceType | String | 资源类型 |
| alarmTemplates.subResourceType | String | 子资源类型 |
| alarmTemplates.name | String | 模板名称 |
| alarmTemplates.comment | String | 备注信息 |
| alarmTemplates.rules | List<AlarmRule> | 报警规则列表 |
请求示例
Plain Text
1POST /v3/bcm?action=DescribeAlarmTemplates HTTP/1.1
2HOST bcm.bj.baidubce.com
3Authorization bce-auth-v1/accessKeyId/2024-10-11T10:00:00Z/1800/host/signature
4
5{
6 "scope": "BCE_BCC",
7 "resourceType": "Instance",
8 "pageNo": 1,
9 "pageSize": 10
10}
响应示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 8a3b5c7d-1234-5678-abcd-ef0123456789
3Date: Fri, 11 Oct 2024 10:10:30 GMT
4Transfer-Encoding: chunked
5Content-Type: application/json;charset=UTF-8
6Server: BWS
7
8{
9 "success": true,
10 "code": "OK",
11 "message": "",
12 "pageNo": 1,
13 "pageSize": 10,
14 "totalCount": 1,
15 "alarmTemplates": [
16 {
17 "id": "32a8a1df1eea4ef5a9854541918b9197",
18 "scope": "BCE_BCC",
19 "resourceType": "Instance",
20 "subResourceType": "",
21 "name": "bcc_temp_1",
22 "comment": "test",
23 "rules": [{"conditions": [{"metricName": "CpuIdlePercent", "metricDimensions": [], "operator": "<", "threshold": 100, "aggregateType": "AVG", "windowSeconds": 300, "displayUnit": "%", "displayThreshold": "100"}], "pendingCount": 1, "checkIntervalSeconds": 60}]
24 }
25 ]
26}
评价此篇文章
