连接组网
站点会话数据
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
siteName | String | 是 | 站点名称 该参数必须指定时,查询指定的站点数据 |
startTime | String | 是 | 1、查询的开始时间,格式:yyyy-mm-ddThh:mm:ss 或 yyyy-mm-ddThh:mm 2、必须小于当前时间和endtime 3、startTime和endTime相差不能超过31天(可联系技术支持调整) 4、只能查询最近半年内数据 |
endTime | String | 是 | 1、查询的结束时间,格式:yyyy-mm-ddThh:mm:ss或 yyyy-mm-ddThh:mm 2、必须小于当前时间,大于starttime 3、startTime和endTime相差不能超过31天(可联系技术支持调整) 4、只能查询最近半年内数据 |
参数名称 | 类型 | 描述 |
---|---|---|
returnCode | Integer | 接口状态码 |
returnMsg | String | 接口信息 |
content | SiteSessionInfoResponseContent | 响应内容 |
siteName | String | 站点名称 |
siteId | Long | 站点 ID |
content | List | 会话数据 |
srcIp | String | 原始IP |
srcPort | Integer | 原始端口 |
destIp | String | 目的IP |
destPort | Integer | 目的端口 |
protocol | String | 协议 |
flow | Number | 流量大小,单位byte |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
4001 | 非法时间参数 | 400 | 非法时间参数 |
4002 | 时间参数不能为空 | 400 | 时间参数不能为空 |
4003 | 开始时间不能早于半年前 | 400 | 开始时间不能早于半年前 |
4004 | 开始与结束时间不能相差超过x天 | 400 | 开始与结束时间不能相差超过x天 |
4005 | 开始时间不能大于结束时间 | 400 | 开始时间不能大于结束时间 |
4006 | 开始结束时间必须小于当前时间 | 400 | 开始结束时间必须小于当前时间 |
5001 | 站点名称不能为空 | 400 | 站点名称不能为空 |
5002 | 站点不存在 | 400 | 站点不存在 |
#!/bin/bash username="example_username" apiKey="example_apiKey" date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` siteName="autotest_owned_initial01" startTime="2021-12-03T15:16" endTime="2021-12-03T16:16" curl -i --url "http://10.8.218.160/api/siteSession/info?siteName=$siteName&startTime=$startTime&endTime=$endTime" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date"
{ "returnCode":"1", "returnMsg" : "success", "content":{ "siteName": "北京总部", "siteId": 740317625433843, "content":[ { "srcIp":"192.168.20.12", "srcPort": 46352, "dstIp": "50.57.54.35", "dstPort": 8080, "protocol":"ftp", "flow": 1852 }, { "srcIp":"192.168.20.12", "srcPort": 46567, "dstIp": "114.114.114.114", "dstPort": 53, "protocol":"dns", "flow": 4552 }] } }