参数说明:
protocol
(整数值)config
拨测对象: 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
拨测周期: period
(单位: 秒)
链接超时: connect_timeout
(单位: 秒)
任务检测超时: timeout
(单位: 秒)
拨测机器: probe_hosts
{"机器Ident1":{"labels":"a=b, c=d"}, "机器Ident2" :{"labels":"w=q"}}
curl --location --request PUT 'https://api.flashcat.cloud/api/n9e-plus/probe/task/create' \
--header 'X-User-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"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"
}