探测任务相关
创建探测任务
请求结构
- method:POST
- URL:/csm/api/v1/site/once/{protocolType}/taskCreate
请求参数
protocolType |
String |
要创建的协议类型,全大写,可选: HTTP/HTTPS/PING/FTP/TCP/UDP/DNS |
是 |
Path参数 |
userId |
String |
用户id |
是 |
RequestBody参数 |
address |
String |
探测地址,如:www.baidu.com |
是 |
RequestBody参数 |
advancedFlag |
Boolean |
是否开启高级配置,HTTP/HTTPS/TCP适用 |
否 |
RequestBody参数 |
ipType |
String |
探测点类型: ipv4/ipv6 |
是 |
RequestBody参数 |
idc |
String |
探测点,可以通过2.1的探测点列表接口获取,多个探测点通过逗号连接,如:beijing-CMNET,beijing-UNICOM |
是 |
RequestBody参数 |
timeout |
int |
超时时间 |
是 |
RequestBody参数 |
protocolType |
String |
要创建的协议类型,全大写,可选:HTTP/HTTPS/PING/FTP/TCP/UDP/DNS。要与请求路径中protocolType一致。 |
是 |
RequestBody参数 |
onceConfig |
OnceConfig |
普通任务配置 |
是 |
RequestBody参数 |
advancedConfig |
AdvancedConfig |
高级任务配置 |
否 |
RequestBody参数 |
groupId |
String |
重新探测创建的任务属于同一个group |
否 |
RequestBody参数 |
taskType |
String |
任务类型,目前只支持:NET_QUAILTY (网络质量) |
是 |
RequestBody参数 |
OnceConfig
名称 |
类型 |
描述 |
anonymousLogin |
boolean |
是否匿名登录,选填 |
method |
String |
HTTP/HTTPS参数,请求方法,必填 |
postContent |
String |
HTTP/HTTPS参数, POST请求内容,选填 |
kidnapWhite |
String |
DNS参数,DNS劫持白名单,选填 |
resolveType |
String |
DNS参数,查询方式,可选:* RECURSION,选填 |
server |
String |
DNS参数,DNS服务器,如:114.114.114.114,选填 |
packetCount |
int |
Ping参数,Ping发包数,必填 |
port |
int |
TCP/UDP/FTP参数,端口号,如:21,必填 |
inputType |
int |
UDP参数,输入类型: 1: 文本 2: 十六进制格式 0: 无,选填 |
input |
String |
UDP参数,请求内容,选填 |
outputType |
int |
UDP参数,输入类型: 1: 文本 2: 十六进制格式 0: 无,选填 |
expectedOutput |
String |
UDP参数,期望输出,选填 |
username |
String |
FTP参数,用户名,选填 |
password |
String |
FTP参数,登陆密码,选填 |
AdvancedConfig
名称 |
类型 |
描述 |
cookies |
String |
HTTP/HTTPS参数,请求头中Cookie字段,选填 |
userAgent |
String |
HTTP/HTTPS参数,请求头中User-Agent字段,选填 |
host |
String |
HTTP/HTTPS参数,请求头中HSOT字段,选填 |
responseCode |
String |
HTTP/HTTPS参数,响应码 Code,选填 |
responseCheck |
String |
HTTP/HTTPS参数,响应内容匹配,选填 |
username |
String |
HTTP/HTTPS参数,验证用户名,选填 |
password |
String |
HTTP/HTTPS参数,验证密码,选填 |
inputType |
int |
TCP参数,输入类型: 1: 文本 2: 十六进制格式 0: 无,选填 |
input |
String |
TCP参数,请求内容,选填 |
outputType |
int |
TCP参数,输入类型:1: 文本 2: 十六进制格式 0: 无,选填 |
expectedOutput |
String |
TCP参数,期望输出,选填 |
请求示例
POST /csm/api/v1/site/once/HTTP/taskCreate
{
"userId": "453bf9588c9e488f9ba2c984129090dc",
"address": "www.baidu.com",
"advancedFlag": true,
"ipType": "ipv4",
"idc": "beijing-CMNET,beijing-UNICOM,beijing-CHINANET,guangdong-CMNET,fujian-CMNET,henan-CMNET,hebei-CHINANET",
"timeout": 60,
"protocolType": "HTTP",
"taskType": "NET_QUAILTY",
"onceConfig": {
"method": "get",
"postContent": "",
"kidnapWhite": "192.168.1.1",
"resolveType": "RECURSION",
"server": "114.114.114.114",
"packetCount": 4,
"port": 22,
"inputType": 2,
"input": "0x11",
"outputType": 2,
"expectedOutput": "0x11",
"username": "",
"password": ""
},
"advancedConfig": {
"cookies": "auth=abc",
"userAgent": "os=macOS",
"host": "1.1.1.1",
"responseCode": "200",
"responseCheck": "success",
"username": "admin",
"password": "",
"inputType": 2,
"input": "0x11",
"outputType": 2,
"expectedOutput": "0x11"
}
}
{
"requestId":"90742375b871445d8907be7748397ef4",
"success":true,
"result":{
"siteId":"jspjUbhwHVotroGFKeRChlriwxlftkxH",
"groupId":"be388838-9381-423e-b4ac-afac8dfe70e3"
},
"code":200
}
探测历史记录
请求结构
- method:POST
- URL:/csm/api/v1/site/once/taskList
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
否 |
RequestBody参数 |
url |
String |
探测地址,如:www.baidu.com,直接模糊查询 |
否 |
RequestBody参数 |
pageNo |
int |
分页数 |
是 |
RequestBody参数 |
pageSize |
int |
分页大小 |
是 |
RequestBody参数 |
order |
String |
返回列表的顺序,默认为 desc 降序,还可选 asc 升序 |
否 |
RequestBody参数 |
orderBy |
String |
排序列表依据的字段,默认为创建时间 |
否 |
RequestBody参数 |
groupId |
String |
重新探测创建的任务属于同一个group |
否 |
RequestBody参数 |
请求示例
POST /csm/api/v1/site/once/taskList
{
"pageNo":1,
"pageSize":10,
"userId": "453bf9588c9e488f9ba2c984129090dc",
"url": "baidu"
}
{
"requestId": "8075cc28167807369286310353357a",
"code": 200,
"result": {
"taskList": [
{
"siteId": "PymZbqvHNJfXRcvSEiBOHmcfBWNAjaDB",
"groupId":"be388838-9381-423e-b4ac-afac8dfe70e3",
"userId": "a0d04d7c202140cb80155ff7b6752ce4",
"taskType": "NET_QUALITY",
"protocolType": "HTTP",
"url": "www.baidu.com",
"agentNum": 7,
"sumSampleNum": 7,
"success": 100,
"monitorTime": "2023-03-06 10:40:14",
"createTime": "2023-03-06 10:40:14",
"status": "FINISH"
}
],
"pageNo": 1,
"pageSize": 10,
"totalCount": 1
},
"success": true,
"message": "success"
}
删除探测记录
请求结构
- method:POST
- URL:/csm/api/v1/site/once/taskDelete
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
是 |
RequestBody参数 |
siteId |
String |
探测任务id |
是 |
RequestBody参数 |
请求示例
POST /csm/api/v1/site/once/taskDelete
{
"userId":"453bf9588c9e488f9ba2c984129090dc",
"siteId":"vLZFWRbcubOVuPgQVgNdZsBiNRuuHIIr"
}
{
"requestId": "aa2431ff8cb74ba2b9a26d788209a77b",
"message": "",
"success": true,
"result": {
"siteId": "vLZFWRbcubOVuPgQVgNdZsBiNRuuHIIr",
"groupId": "d13f2b4a-1892-44cb-a3f4-0c7ede23826d"
},
"code": 200
}
探测任务结果
请求结构
- method:POST
- URL: /csm/api/v1/site/once/loadData
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
是 |
RequestBody参数 |
siteId |
String |
任务ID |
是 |
RequestBody参数 |
pageNo |
int |
分页数 |
是 |
RequestBody参数 |
pageSize |
int |
分页大小 |
是 |
RequestBody参数 |
order |
String |
asc/desc |
否 |
RequestBody参数 |
orderBy |
String |
排序字段,只能传对应协议类型的指标名 |
否 |
RequestBody参数 |
filterArea |
String |
按省市过滤探测结果,优先级更高,和filterIsp二选一 |
否 |
RequestBody参数 |
filterIsp |
String |
按运营商过滤探测结果,和area只能传一个 |
否 |
RequestBody参数 |
请求示例
POST /csm/api/v1/site/once/loadData
{
"pageNo":1,
"pageSize":10,
"filterArea": "beijing",
"userId":"453bf9588c9e488f9ba2c984129090dc",
"siteId":"vLZFWRbcubOVuPgQVgNdZsBiNRuuHIIr"
}
{
"requestId": "aa2431ff8cb74ba2b9a26d788209a77b",
"code": 200,
"result": {
"totalNum": 1,
"pageNo": 1,
"pageSize": 10,
"order": "desc",
"orderBy": "monitorTime",
"status": "FINISH",
"protocolType": "HTTP",
"url": "www.baidu.com",
"taskType": "NET_QUALITY",
"filterArea": "beijing",
"filterIsp": "CMNET",
"siteId": "id",
"jobId": "id",
"groupId": "id",
"userId": "id",
"metricOrder": [
"totalTime",
"dnsTime",
"dnsKidnap"
],
"allAreas": [
"hebei",
"tianjin",
"hubei",
"beijing",
"fujian"
],
"overviewData": {
"metrics": {
"connectTime": 17.2,
"dnsTime": 0.005
},
"success": 89,
"sumSampleNum": 7,
"rightSampleNum": 7,
"errSampleNum": 0
},
"detailData": [
{
"id": 123,
"agentProv": "shanghai",
"agentIsp": "CHINANET",
"clientId": "122.137.20.16.1",
"clientCity" : "上海",
"remoteAddr": "220.181.38.150",
"remoteCity": "保定",
"remoteArea":"河北",
"remoteCounty":"顺平",
"ipProtocol": "ipv4",
"url": "www.baidu.com",
"analysisResult": [
"112.53.42.114",
"112.53.42.52",
"2402:4e00:1020:1404:0:9227:71a3:83d2",
"2402:4e00:1020:1404:0:9227:71ab:2b74",
"ins-r23tsuuf.ias.tencent-cloud.net."
],
"metrics": {
"dnsTime": 0.02,
"packetLostRate": 0,
"connectTime": 44,
"redirectTime": 0,
"totalTime": 395
},
"success": 100,
"monitorTime": "2023-03-06 10:40:55",
"status": "FINISH"
}
],
"taskConfig": {
...
}
},
"success": true,
"message": "success"
}
探测详情
请求结构
- Method:POST
- URL:/csm/api/v1/site/once/groupTask
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
是 |
RequestBody参数 |
siteId |
String |
任务ID |
否 |
RequestBody参数 |
siteIds |
List<String> |
任务id列表,和groupId字段只生效一个,优先groupId |
否 |
RequestBody参数 |
groupId |
String |
组id,同源任务为一个组 |
否 |
RequestBody参数 |
pageNo |
int |
分页数 |
是 |
RequestBody参数 |
pageSize |
int |
分页大小 |
是 |
RequestBody参数 |
order |
String |
asc/desc |
否 |
RequestBody参数 |
orderBy |
String |
排序字段,只能传对应协议类型的指标名 |
否 |
RequestBody参数 |
filterArea |
String |
按省市过滤探测结果,优先级更高,和filterIsp二选一 |
否 |
RequestBody参数 |
filterIsp |
String |
按运营商过滤探测结果,和area只能传一个 |
否 |
RequestBody参数 |
响应示例
POST /csm/api/v1/site/once/groupTask
{
"groupId": "groub0716ac8-9bf5-4a65-819c-a708f88cd013pId",
"userId": "453bf9588c9e488f9ba2c984129090dc",
"siteId": "jspjUbhwHVotroGFKeRChlriwxlftkxH",
"pageNo": 1,
"pageSize": 10,
"order": "desc",
"orderBy": "monitorTime"
"filterIsp": "CMNET",
}
{
"requestId": "aa2431ff8cb74ba2b9a26d788209a77b",
"code": 200,
"result": {
"totalNum": 1,
"sumSampleNum":66
"pageNo": 1,
"pageSize": 10,
"order": "desc",
"orderBy": "monitorTime",
"protocolType": "HTTP",
"url": "www.baidu.com",
"taskType": "NET_QUALITY",
"filterArea": "beijing",
"filterIsp": "CMNET",
"groupId": "id",
"allAreas": [
"hebei",
"tianjin",
"hubei",
"beijing",
"fujian"
],
"overviewData": {
"metrics": {
"connectTime": 17.2,
"dnsTime": 0.005
},
"success": 89,
"sumSampleNum": 7,
"rightSampleNum": 7,
"errSampleNum": 0
},
"detailData": [
{
"id": 123,
"region":"EAST",
"agentProv": "shanghai",
"agentIsp": "CHINANET",
"clientId": "122.137.20.16.1",
"remoteAddr": "220.181.38.150",
"clientCity" : "上海",
"remoteCity": "保定",
"remoteArea":"河北",
"remoteCounty":"顺平",
"ipProtocol": "ipv4",
"url": "www.baidu.com",
"analysisResult": [
"112.53.42.114",
"112.53.42.52",
"2402:4e00:1020:1404:0:9227:71a3:83d2",
"2402:4e00:1020:1404:0:9227:71ab:2b74",
"ins-r23tsuuf.ias.tencent-cloud.net."
],
"metrics": {
"dnsTime": 0.02,
"packetLostRate": 0,
"connectTime": 44,
"redirectTime": 0,
"totalTime": 395
},
"success": 100,
"monitorTime": "2023-03-06 10:40:55",
"status": "FINISH"
}
]
},
"success": true,
"message": "success"
}
重新探测
请求结构
- Method:POST
- URL:/csm/api/v1/site/once/createFromTask
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
是 |
RequestBody参数 |
siteId |
String |
任务详情展示的id,组结果需要过滤当前任务 |
是 |
RequestBody参数 |
响应示例
POST /csm/api/v1/site/once/createFromTask
{
"siteId": "SVierfbmcidTWxysYCsvsHwANzaFh***",
"userId": "a0d04d7c202140cb80155ff7b6752***",
}
{
"requestId": "10c6cc006a544477918e3440e4a8b026",
"message": "",
"success": true,
"result": {
"siteId": "LToOrLqHTPhrhTRppTzHJAtMtPNhrmHL",
"groupId": "dadb06bb-bffe-449d-99b6-d52af98634d4"
},
"code": 200
}
历史探测列表
请求结构
- Method:POST
- URL:/csm/api/v1/site/once/groupTaskList
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
否 |
RequestBody参数 |
siteId |
String |
任务详情展示的id,组结果需要过滤当前任务 |
否 |
RequestBody参数 |
groupId |
String |
组id |
否 |
RequestBody参数 |
响应示例
POST /csm/api/v1/site/once/groupTaskList
{
"userId": "453bf9588c9e488f9ba2c984129090dc",
"groupId": "de3cf1fa-a53c-45b0-a331-6a054218b1e4",
"siteId" : "YjrgZFVzXOidYPSgkOzSJZAKuazZAKGH",
}
{
"requestId": "8075cc28167807369286310353357a",
"code": 200,
"result": {
"taskList": [
{
"siteId": "YjrgZFVzXOidYPSgkOzSJZAKuazZAKGH",
"groupId":"de3cf1fa-a53c-45b0-a331-6a054218b1e4",
"url": "www.baidu.com",
"createTime": "2023-03-06 10:40:14",
}
],
"totalCount": 1
},
"success": true,
"message": "success"
}
探测点接口
获取当前探测点
请求结构
- Method:GET
- URL:/csm/api/v1/site/once/siteAgent
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
是 |
Query参数 |
ipType |
String |
ip的类型,ipv6、ipv4两种 |
否 |
Query 参数 |
响应示例
GET /csm/api/v1/site/once/siteAgent?userId=453bf9588c9e488f9ba2c984129090dc
{
"requestId": "6d1cfdc92bc14f99862e1b7fa05713a5",
"success": true,
"result": {
{
"whiteUser": true,
"siteAgents": [
{
"agentId": "shandong-CMNET",
"agentName": "山东移动",
"region": "EAST"
"status": 10,
"ipv6Status": 1,
},
{
"agentId": "xizang-CMNET",
"agentName": "西藏移动",
"region": "NORTHWEST"
"status": 10,
"ipv6Status": 1,
}
]
},
"code": 200
}