获取告警线设置
<基本信息>
Path: /apiapi/task/threshold
Method: GET
请求参数类型: URL路径参数
响应参数类型:JSON
<请求参数>
Query
参数名称 | 是否必须 | 参数类型 | 默认值 | 示例 | 备注 |
task_id | 是 | int | 无 | 不传任务ID的时候只返回告警线的配置 |
请求示例
curl -H "token:a3af84f7c1d0d935024ba58b5da78aaa" https://v6-api.jiankongbao.com/apiapi/task/threshold?task_id=155
<返回数据>
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
task_threshold | object | 非必须 | 任务的告警线设置 | 备注: 任务的告警线设置 item 类型: object | |
alert_num | number | 必须 | 连续触发次数 | 备注: 连续触发次数 | |
alert_status | number | 必须 | 0-未触发(绿色) 1-触发(黄色) | 备注: 0-未触发(绿色) 1-触发(黄色) | |
custom_switch | number | 必须 | 告警线状态 | 备注: 告警线状态 | |
monitor_type | string | 必须 | 监测点类型 | 备注: 监测点类型 | |
monitor_value | string | 必须 | 监测点个数 | 备注: 监测点个数 | |
requirement | string | 必须 | 对比条件 | 备注: 对比条件 | |
requirement_default | string | 必须 | 对比条件默认值 | 备注: 对比条件默认值 | |
target_type | string | 必须 | 告警指标, | 备注: 告警指标, | |
threshold_value | string | 必须 | 阈值 | 备注: 阈值 | |
unit_default | string | 必须 | 单位默认值 | 备注: 单位默认值 | |
unit | string | 必须 | 单位 | 备注: 单位 | |
threshold_template | object | 非必须 | 告警线配置 | 备注: 告警线配置 item 类型: object | |
target_type | string | 必须 | 告警指标, | 备注: 告警指标, | |
requirement | string | 必须 | 对比条件 | 备注: 对比条件 item 类型: string | |
requirement_default | string | 必须 | 对比条件默认值 | 备注: 对比条件默认值 | |
threshold_value | string | 必须 | 阈值 | 备注: 阈值 | |
unit | string | 必须 | 单位 | 备注: 单位 item 类型: string | |
unit_default | string | 必须 | 单位默认值 | 备注: 单位默认值 | |
monitor_type | string | 必须 | 监测点类型 | 备注: 监测点类型 item 类型: string | |
monitor_type_default | string | 必须 | 监测点类型默认值 | 备注: 监测点类型默认值 | |
monitor_value | number | 必须 | 监测点个数 | 备注: 监测点个数 | |
alert_num | number | 必须 | 连续触发次数 | 备注: 连续触发次数 | |
custom_switch | number | 必须 | 告警线状态 | 备注: 告警线状态 |
请求示例
{"task_threshold":[{"target_type":"pc_respose_time","requirement":"gt","threshold_value":"2000","alert_num":"2","unit":"ms","monitor_type":"pc_assign","monitor_value":"[\"2\"]","custom_switch":1,"alert_status":0,"monitor_value_select":["2"],"monitor_value_input":1},{"target_type":"pc_availability","requirement":"lt","threshold_value":"100","alert_num":"2","unit":"%","monitor_type":"null","monitor_value":"null","custom_switch":1,"alert_status":0},{"target_type":"pc_correctness","requirement":"lt","threshold_value":"100","alert_num":"2","unit":"%","monitor_type":"null","monitor_value":"null","custom_switch":0,"alert_status":0},{"target_type":"pc_availability_ness","requirement":"eq","threshold_value":"0","alert_num":"2","unit":"","monitor_type":"all","monitor_value":"0","custom_switch":0,"alert_status":0},{"target_type":"pc_correctness_ness","requirement":"eq","threshold_value":"0","alert_num":"2","unit":"","monitor_type":"all","monitor_value":"0","custom_switch":0,"alert_status":0}],"threshold_template":[{"target_type":"pc_respose_time","requirement":["gt","lt","eq"],"requirement_default":"gt","threshold_value":2000,"unit":["ms","s"],"unit_default":"ms","monitor_type":["radom","pc_assign"],"monitor_type_default":"radom","monitor_value":1,"alert_num":2,"custom_switch":0},{"target_type":"pc_availability","requirement":["gt","lt","eq"],"requirement_default":"lt","threshold_value":"100","unit":["%"],"unit_default":"%","alert_num":2,"custom_switch":0},{"target_type":"pc_correctness","requirement":["gt","lt","eq"],"requirement_default":"lt","threshold_value":"100","unit":["%"],"unit_default":"%","alert_num":2,"custom_switch":0},{"target_type":"pc_availability_ness","requirement":["eq"],"requirement_default":"eq","threshold_value":"0","unit":[],"unit_default":"","monitor_type":["all","radom"],"monitor_type_default":"all","monitor_value":0,"alert_num":2,"custom_switch":0},{"target_type":"pc_correctness_ness","requirement":["eq"],"requirement_default":"eq","threshold_value":"0","unit":[],"unit_default":"","monitor_type":["all","radom"],"monitor_type_default":"all","monitor_value":0,"alert_num":2,"custom_switch":0}]}