告警与响应相关接口/告警规则
POSTAlerting起始版本 1.0同步需要认证
创建告警抑制规则
创建新抑制规则关联抑制中告警。
调试可用性
在线调试
使用当前认证信息和示例参数提交 Mock 请求。
请求参数
请求体字段
nameString必填资源名称。
示例: Suppress disk alerts when host down
descriptionString必填资源的详细描述。
示例: Suppress disk alerts when host is unreachable
sourceMatchString必填源告警匹配器表达式。
示例: alertname=HostDown
targetMatchString必填目标告警匹配器表达式。
示例: alertname=DiskFull
equalLabelsString必填等于标签。
示例: host,cluster
响应状态
请求地址
POST/api/v1/alerting/inhibition-rules
/api/v1/alerting/inhibition-rules
请求示例
curl -X POST '{host}/api/v1/alerting/inhibition-rules' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"name":"Suppress disk alerts when host down","description":"Suppress disk alerts when host is unreachable","sourceMatch":"alertname=HostDown","targetMatch":"alertname=DiskFull","equalLabels":"host,cluster"}'
响应示例
200{
"uuid": "inhib-001",
"name": "Suppress disk alerts when host down",
"description": "Suppress disk alerts when host is unreachable",
"sourceMatch": "alertname=HostDown",
"targetMatch": "alertname=DiskFull",
"equalLabels": "host,cluster",
"enabled": true,
"createDate": "example"
}变更历史
此 API 暂无变更历史记录。
