获取规则列表
开发中
GET
https://api.flashcat.cloud/api/n9e/busi-groups/alert-rules
最后修改时间:2025-03-16 09:24:11
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.flashcat.cloud/api/n9e/busi-groups/alert-rules?gids=1' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfdXVpZCI6IjJlODA5MDQwLTE1NjItNDBmYS1hZTQ0LTQwNzg0NGIyMjUzMSIsImF1dGhvcml6ZWQiOnRydWUsImV4cCI6MTcyNTQzNjExNywidXNlcl9pZGVudGl0eSI6IjEtcm9vdCJ9.vG2GQaMpAmzcgP3CPI1AS3aTY5p6g1XTcR-UzLiPGmU' \
--header 'X-Language: zh_CN'
响应示例响应示例
{
"dat": [
{
"id": 7,
"group_id": 1,
"cate": "prometheus",
"datasource_ids": null,
"cluster": "",
"name": "InstanceDown",
"note": "",
"prod": "metric",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 1,
"severities": [
1
],
"disabled": 1,
"prom_for_duration": 300,
"prom_ql": "",
"rule_config": {
"algo_params": null,
"inhibit": false,
"prom_ql": "",
"queries": [
{
"prom_ql": "up == 0",
"severity": 1
}
],
"severity": 0
},
"event_relabel_config": null,
"prom_eval_interval": 15,
"enable_stime": "00:00",
"enable_stimes": [
"00:00"
],
"enable_etime": "23:59",
"enable_etimes": [
"23:59"
],
"enable_days_of_week": [
"0",
"1",
"2",
"3",
"4",
"5",
"6"
],
"enable_days_of_weeks": [
[
"0",
"1",
"2",
"3",
"4",
"5",
"6"
]
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [],
"notify_groups_obj": [],
"notify_groups": [],
"notify_repeat_step": 60,
"notify_max_number": 0,
"recover_duration": 0,
"callbacks": [],
"runbook_url": "",
"append_tags": [],
"annotations": {
"summary": ""
},
"extra_config": null,
"create_at": 1722854356,
"create_by": "root",
"update_at": 1722854377,
"update_by": "root",
"uuid": 0,
"cur_event_count": 0
},
{
"id": 2,
"group_id": 1,
"cate": "prometheus",
"datasource_ids": [
1
],
"cluster": "",
"name": "Mysql has just restarted. Please be advised - categraf",
"note": "MySQL has just been restarted, less than one minute ago",
"prod": "metric",
"algorithm": "",
"algo_params": null,
"delay": 0,
"severity": 0,
"severities": [
3
],
"disabled": 0,
"prom_for_duration": 0,
"prom_ql": "",
"rule_config": {
"inhibit": false,
"queries": [
{
"keys": {
"labelKey": "",
"valueKey": ""
},
"prom_ql": "mysql_global_status_uptime < 60",
"severity": 3
}
]
},
"event_relabel_config": null,
"prom_eval_interval": 15,
"enable_stime": "00:00",
"enable_stimes": [
"00:00"
],
"enable_etime": "23:59",
"enable_etimes": [
"23:59"
],
"enable_days_of_week": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
],
"enable_days_of_weeks": [
[
"1",
"2",
"3",
"4",
"5",
"6",
"0"
]
],
"enable_in_bg": 0,
"notify_recovered": 1,
"notify_channels": [
"feishu"
],
"notify_groups_obj": [
{
"id": 1,
"name": "demo-root-group",
"note": "",
"create_at": 1720501106,
"create_by": "root",
"update_at": 1720501106,
"update_by": "root",
"users": null
}
],
"notify_groups": [
"1"
],
"notify_repeat_step": 60,
"notify_max_number": 0,
"recover_duration": 0,
"callbacks": [
"testurl"
],
"runbook_url": "",
"append_tags": [
"alertname=MysqlRestarted"
],
"annotations": {},
"extra_config": null,
"create_at": 1720531112,
"create_by": "root",
"update_at": 1725346158,
"update_by": "root",
"uuid": 0,
"cur_event_count": 1
}
],
"err": ""
}
请求参数
Query 参数
gids
string
必需
示例值:
1
Header 参数
Authorization
string
必需
示例值:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfdXVpZCI6IjJlODA5MDQwLTE1NjItNDBmYS1hZTQ0LTQwNzg0NGIyMjUzMSIsImF1dGhvcml6ZWQiOnRydWUsImV4cCI6MTcyNTQzNjExNywidXNlcl9pZGVudGl0eSI6IjEtcm9vdCJ9.vG2GQaMpAmzcgP3CPI1AS3aTY5p6g1XTcR-UzLiPGmU
X-Language
string
必需
示例值:
zh_CN