更新拨测任务
开发中
POST
https://api.flashcat.cloud/api/n9e-plus/probe/task/{taskid}/update
最后修改时间:2025-05-13 07:56:03
参数说明:
- 协议类型:
protocol
(整数值)
- 值含义: 0: HTTP 1: ICMP 2: TCP 3: UDP 4: WSDL
- 关联配置:
config
- 值含义:
- follow_redirects: true/false (是否跟随重定向)
- insecure_skip_verify: true/false (https是否忽略证书校验)
- probe_host_percent: 1~100 (拨测机器比例数, 用于计算最终参数拨测的机器)
- ping_interval: 0.5 (默认ping发包频率,单位秒)
- ping_count: 5 (默认ping发包数)
- ping_interface: "" (指定网卡,ping -I/-S <INTERFACE/SRC_ADDR>)
- data_source_ids: [1,2] (指定读取拨测指标的数据源id)
-
拨测对象:
targets
多个拨测对象,用'\n'分隔开 (如: "www.baidu.com\nwww.qq.com") -
拨测方法:
method
(GET 、POST、HEAD、exec)exec: 比较特殊,对于icmp协议,用于指定使用系统ping命令
-
响应码验证:
expect_response_codes
(格式: 200 或 2xx 或 2xx|3xx|4xx|5xx) -
响应body验证:
expect_response_string
根据返回body内容,进行匹配的内容 -
响应body验证匹配方式:
match_pattern
- 值含义: "complete" 完全匹配 "substring" 部分匹配
-
拨测周期:
period
(单位: 秒) -
链接超时:
connect_timeout
(单位: 秒) -
任务检测超时:
timeout
(单位: 秒) -
拨测机器:
probe_hosts
- 格式: (机器Ident: 是指在页面上, 数据接入 => 对象列表 ,表格中"标识"内容)
{"机器Ident1":{"labels":"a=b, c=d"}, "机器Ident2" :{"labels":"w=q"}}
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.flashcat.cloud/api/n9e-plus/probe/task//update' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":2,
"name": "任务测试",
"description": "",
"busi_group": 37,
"labels": "custom=abc,task=probe",
"protocol": 0,
"method": "GET",
"encoding": "utf8",
"config": {
"follow_redirects": true,
"insecure_skip_verify": false,
"probe_host_percent": 100,
"auto_detect": true,
"data_source_ids": [
11
],
"ping_count":5,
"ping_interface":"",
"ping_interval": 0.5
},
"targets": "http://www.baidu.com",
"header": "Auth: xx2xx",
"body": "{}",
"param": "a=b&c=d",
"expect_response_codes": "2xx",
"match_pattern": "substring",
"expect_response_string": "\"status\": \"ok\"",
"periodPiece": "second",
"period": 10,
"timeout": 10,
"connect_timeout": 10,
"probe_hosts": {
"dev-n9e-01": {
"labels": "test=host"
},
"zke-categraf-test": {
"labels": "",
"busi_group": ""
}
}
}'
响应示例响应示例
{
"error": {
"code": "InvalidParameter",
"message": "string"
},
"request_id": "string"
}
请求参数
Path 参数
taskid
string
必需
Body 参数application/json