<HTTP创建-请求参数>:
参数名称 | 是否必须 | 类型 | 默认值 | 描述 |
task_type | 是 | string | 任务类型 | |
infos | 是 | object[] | 任务批量信息 | |
infos.task_name | 是 | string | 任务名称 | |
infos.url | 是 | string | 任务url | |
partition_flag | 是 | string | 任务性质,可选值:
| |
network_protocol | 是 | string | 任务使用的网络协议。 可选值:
内网任务只能选择4。 | |
submit_method | 否 | number | 0 | HTTP请求方法
|
param | 否 | string | ||
pattern_target | 否 | int | 匹配目标(0:响应内容;1:响应头) | |
pattern_type | 否 | Int | 0 | 匹配方式(0:包含;1:不包含) |
pattern_str | 否 | string | 匹配响应内容 | |
cookies | 否 | string | cookies信息 | |
http_user | 否 | string | HTTP验证用户名 | |
http_pwd | 否 | string | HTTP验证密码 | |
ip | 否 | string | 指定服务器IP | |
https_sslv | 否 | int | 0 | ssl版本,仅外网支持
|
ssl_verify | 否 | int | 0 | 是否开启ssl证书认证,仅外网支持
|
header | 否 | object[] | HTTP请求头信息 | |
header.name | 否 | |||
header.value | 否 | |||
redirect | 否 | int | 0 | 是否支持301/302重定向
|
redirect_times | 否 | int | 3 | 最大跳数(仅支持设置3次或5次) |
http_code_transform_from | 否 | string | 转码前的http响应状态码,多个状态之间可以用英文逗号隔开,仅支持外网监控。 | |
http_code_transform_to | 否 | string | 200 | 转码后的http响应状态码,只支持200。仅支持外网监控。 |
group_id | 是 | int | 监测点分组id。内网使用采集器时id值为0 | |
plugin_task_uselist_id | 否 | number[] | 采集器id,当是内网任务且分组id为0时,该值为必填参数 | |
frequency | 是 | int | 监测频率,单位分钟,可选值:2,5,10,15,20,30,60 | |
reminds | 是 | int | 连续告警频率(监控频率的倍数),可选值:0,1,2,3,5,10,20,30 | |
retry | 是 | int | 重试次数,可选值:1,2,3。只有外网任务支持设置,内网次数默认为1。 | |
history | 是 | int | 是否记录快照,可选值:
| |
all_snapshot | 是 | int | 是否记录全量快照,可选值:
| |
task_scope | 是 | object | 公开范围 | |
task_scope.type | 是 | int | 类型,可选值:
| |
task_scope.organization | 否 | number[] | 指定分组id,type=2时使用 | |
task_scope.user | 否 | number[] | 指定用户id,type=4时使用 | |
threshold_setting | 否 | object[] | 自定义告警线,告警线各指标详细描述信息可参考<创建任务的自定义告警规则> | |
threshold_setting.metric | 否 | int | 告警指标 | |
threshold_setting.cond | 否 | string | 条件 | |
threshold_setting.value | 否 | int | 阈值 | |
threshold_setting.unit | 否 | string | 单位 | |
threshold_setting.advanced_strategy_type | 否 | int | 高级策略类型 | |
threshold_setting.advanced_status | 否 | int | 告警策略开关 | |
threshold_setting.status | 否 | int | 告警线开关 | |
threshold_setting.retry | 否 | string | 高级策略重试次数 | |
threshold_setting.monitor_set | 否 | string | 触发的监测点个数类型 1: 任意 2:指定 3:平均 | |
threshold_setting.recover_continuous_times | 否 | string | 高级策略判断恢复的连续次数 | |
threshold_setting.trigger_accumulate_times | 否 | string | 高级策略判断触发的连续次数 | |
threshold_setting.monitor_count | 否 | int | 设置触发的任意监测点个数 | |
threshold_setting.type | 否 | string | 告警线类型,要与任务类型task_type一致。 | |
remind_setting | 否 | object | 告警通知设置 | |
remind_setting.email | 否 | number[] | 邮件,item 类型: number | |
remind_setting.push | 否 | string[] | app推送,item 类型: string | |
remind_setting.remind | 否 | number[] | 连续提醒,item 类型: number | |
remind_setting.sms | 否 | string[] | 短信,item 类型: string | |
remind_setting.voice | 否 | string[] | 语音,item 类型: string | |
remind_setting.wechat | 否 | string[] | 企业微信,item 类型: string | |
remind_setting.webhook | 否 | number[] | webhook机器人,item 类型: number |
<HTTP创建-请求示例>:
curl -H "token:a3af84f7c1d0d935024ba58b5da78aaa" https://v6-api.jiankongbao.com/siteapi/tasks/batch/info -d '{"task_type":"http","infos":[{"task_name":"batch-http-intranet-test","url":"https://www.163.com"}],"partition_flag":"Intranet","submit_method":0,"pattern_target":0,"pattern_type":0,"pattern_str":"","cookies":"","http_user":"","http_pwd":"","ip":"","https_sslv":0,"ssl_verify":0,"header":[],"redirect":0,"redirect_times":3,"http_code_transform_from":"403","http_code_transform_to":"200","network_protocol":"4","group_id":0,"plugin_task_uselist_id":[100000168,100000169],"frequency":15,"reminds":3,"retry":1,"history":1,"all_snapshot":1,"task_scope":{"type":4,"user":[2670]},"threshold_setting":[{"metric":4,"cond":"12","value":1000,"unit":"HTTP_ERR_CONNECT","advanced_strategy_type":0,"advanced_status":2,"status":0,"retry":"1","monitor_set":"1","recover_continuous_times":"1","trigger_accumulate_times":"1","monitor_count":3,"type":"http"}],"remind_setting":{"email":[2670,25228255],"push":[],"remind":[2670,25228255],"sms":[],"voice":[],"wechat":[],"webhook":[1901135]}}'