查询报警策略详情
更新时间:2026-06-26
查询报警策略
查询报警策略详情,该接口用于获取指定报警策略的完整配置信息。
API Explorer
去调试
您可以在 API Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,API Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1POST /v3/bcm?action=DescribeAlarmPolicy HTTP/1.1
2Host: bcm.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "id": "ajshhfanzndafadfggaa",
7 "requireSubResourceType": true
8}
请求头域
除公共头域外,无其他特殊头域
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号,当前取值为v3 |
| id | String | 是 | RequestBody参数 | 策略ID |
| requireSubResourceType | Boolean | 否 | RequestBody参数 | 是否返回SubResourceType,默认值:false |
返回状态码
成功返回200,失败返回见错误码
返回头域
除公共头域外,无其他特殊头域
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| success | Boolean | 请求是否成功 |
| code | String | 响应码 |
| message | String | 错误信息 |
| id | String | 策略ID |
| name | String | 策略名称 |
| scope | String | 云产品类型 |
| resourceType | String | 资源类型 |
| subResourceType | String | 子资源类型(当requireSubResourceType=true时返回) |
| target | AlarmTarget | 报警目标配置 |
| rules | List<AlarmRule> | 报警规则列表 |
| actions | List<PolicyAction> | 报警通知项列表 |
| createdTime | String | 创建时间,UTC格式 |
| updatedTime | String | 更新时间,UTC格式 |
请求示例
Plain Text
1POST /v3/bcm?action=DescribeAlarmPolicy HTTP/1.1
2HOST bcm.bj.baidubce.com
3Authorization bce-auth-v1/accessKeyId/2024-10-11T10:00:00Z/1800/host/signature
4
5{
6 "id": "ajshhfanzndafadfggaa",
7 "requireSubResourceType": true
8}
响应示例
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 "id": "ajshhfanzndafadfggaa",
13 "name": "CPU使用率过高报警策略",
14 "scope": "BCE_BCC",
15 "resourceType": "Instance",
16 "subResourceType": "",
17 "createdTime": "2025-04-19T10:01:12Z",
18 "updatedTime": "2025-04-19T10:01:12Z",
19 "target": {"type": "INSTANCE_GROUPS", "instanceGroups": ["uuid-1", "uuid-2"], "instanceGroupNames": ["instance-group-1", "instance-group-2"]},
20 "rules": [{"content": "CPU空闲率小于10%,连续发生3次触发报警", "conditions": [{"metricName": "CpuIdlePercent", "metricDimensions": [], "operator": "<", "threshold": 10.0, "aggregateType": "AVG", "windowSeconds": 300, "displayUnit": "%", "displayThreshold": "10"}], "pendingCount": 3, "checkIntervalSeconds": 60}],
21 "actions": [{"notifyId": "notify_template_001"}]
22}
评价此篇文章
