新增通知规则
POST
https://api.flashcat.cloud/api/n9e/notify-rules
最后修改时间:2025-05-20 06:06:44
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.flashcat.cloud/api/n9e/notify-rules' \
--header 'Content-Type: application/json' \
--data-raw '[{
"name": "High CPU Alert",
"description": "Alert when CPU usage exceeds 80%",
"enable": true,
"user_group_ids": [1,2],
"notify_configs": [
{
"channel_id": 1,
"template_id": 2,
"params": {
"threshold": 80
},
"severities": [1, 2],
"time_ranges": [
{
"start": "08:00",
"end": "18:00",
"week": [1, 2]
}
],
"label_keys": [
{
"key": "env",
"op": "==",
"value": "production"
}
]
}
]
}]'
响应示例响应示例
{
"dat": [
{
"id": 1,
"name": "High CPU Alert",
"description": "Alert when CPU usage exceeds 80%",
"enable": true,
"user_group_ids": [
1,
2
],
"notify_configs": [
{
"channel_id": 1,
"template_id": 2,
"params": {
"threshold": 80
},
"severities": [
1,
2
],
"time_ranges": [
{
"start": "08:00",
"end": "18:00",
"week": [
1,
2
]
}
],
"label_keys": [
{
"key": "env",
"op": "==",
"value": "production"
}
]
}
]
}
],
"err": ""
}
请求参数
Body 参数application/json