创建单个告警规则
POST
https://api.flashcat.cloud/v1/n9e/alert-rule-add
最后修改时间:2024-03-08 11:52:18
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.flashcat.cloud/v1/n9e/alert-rule-add' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
"disabled": 1,
"name": "0cls_enrich",
"append_tags": [],
"note": "",
"prod": "anomaly",
"rule_config": {
"prom_ql": "aa",
"severity": 1,
"algo_params": {
"seasonal_duration": 604800,
"upper_bound": 1,
"upper_times_num": 1,
"lower_bound": 1,
"lower_times_num": 1
}
},
"enable_status": false,
"extra_config": {
"custom_notify_tpl": {
"dingtalk": "tx-sms",
"wecom": "wecom"
},
"escalation": {
"enable": true,
"for_duration": 60,
"notify_repeat_step": 60,
"notify_max_number": 0,
"redefine_severity": true,
"new_severity": 2,
"redefine_channels": true,
"new_channels": [
"wecom"
],
"notify_groups": []
},
"notify_aggregation": {
"enable": false,
"wait": 1
}
},
"notify_channels": [
"wecom",
"dingtalk"
],
"notify_groups": [
"8"
],
"notify_recovered": 1,
"recover_duration": 0,
"notify_repeat_step": 1,
"notify_max_number": 0,
"callbacks": [],
"annotations": {},
"cate": "prometheus",
"datasource_ids": [
79
],
"prom_eval_interval": 20,
"prom_for_duration": 60,
"enable_in_bg": 0,
"enable_days_of_weeks": [
[
"0",
"1",
"2",
"3",
"4",
"5",
"6"
]
],
"enable_stimes": [
"00:00"
],
"enable_etimes": [
"00:00"
]
}'
响应示例响应示例
{
"dat": 1,
"err": ""
}
请求参数
Body 参数application/json
返回响应
修改于 2024-03-08 11:52:18