新增推送告警的策略。
調試
您可以在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"
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。