新增推送告警的策略
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
sysom:CreateAlertStrategy |
none |
*全部资源
|
无 | 无 |
请求语法
POST /api/v1/alertPusher/alert/createStrategy HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| body |
object |
否 |
请求 Body |
|
| enabled |
boolean |
是 |
告警策略是否生效 |
false |
| k8sLabel |
boolean |
否 |
k8s 标签 |
|
| name |
string |
是 |
告警策略名称 |
strategy1 |
| strategy |
object |
是 |
告警策略详情 |
|
| clusters |
array |
否 |
接收告警的集群合集 |
|
|
string |
否 |
集群名称 |
cluster1 |
|
| destinations |
array |
否 |
告警联系人 |
|
|
integer |
否 |
告警联系人 |
||
| items |
array |
否 |
接收告警的异常项合计 |
|
|
string |
否 |
异常项 |
节点CPU使用率检测 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| code |
string |
状态码
|
Success |
| data |
any |
返回数据。 |
{ "uid": "uid-1", "name": "test-name", "strategy": { "clusters": ["test-cluster-1","test-cluster-2"], "items": ["test-item1","test-item2"] }, "enabled": True, } |
| message |
string |
错误信息
|
创建策略失败 |
| requestId |
string |
Id of the request |
2D693121-C925-5154-8DF6-C09A8B369822 |
示例
正常返回示例
JSON格式
{
"code": "Success",
"data": "{\n \"uid\": \"uid-1\",\n \"name\": \"test-name\",\n \"strategy\": {\n \"clusters\": [\"test-cluster-1\",\"test-cluster-2\"],\n \"items\": [\"test-item1\",\"test-item2\"]\n },\n \"enabled\": True,\n \n }",
"message": "创建策略失败",
"requestId": "2D693121-C925-5154-8DF6-C09A8B369822"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。