连接组网
站点带宽流量图表
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、只能查询最近半年内数据 |
chartAccuracy | Integer | 否 | 时间间隔,枚举 1 = 1分钟 2 = 5分钟 不传默认5分钟 |
参数名称 | 类型 | 描述 |
---|---|---|
returnCode | Integer | 接口状态码 |
returnMsg | String | 接口信息 |
content | SiteTotalFlowChartResponseContent | 响应内容 |
siteName | String | 站点名称 |
siteId | Long | 站点 ID |
allocateBandwidth | Number | 分配带宽,单位:Mbps |
bandwidths | SiteTotalFlowChartResponseContentBandwidths | 带宽趋势数据 |
timeStamp | List | 时间戳 |
timeData | List | 时间分片 |
upStreamBandwidth | List | 单位为byte,1min粒度,直接显示上行流量,5min粒度,显示5min内的平均上行流量,带宽(Mbps)=流量/1000/1000/60 |
downStreamBandwidth | List | 单位为byte,1min粒度,直接显示下行流量,5min粒度,显示5min内的平均下行流量,带宽(Mbps)=流量/1000/1000/60 |
错误代码(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` siteAName="autotest_owned_initial01" siteBName="autotest_cpe_initial01" startTime="2021-12-03T15:16" endTime="2021-12-03T16:16" curl -i --url "http://10.8.218.160/api/siteLogic/qualityChart?siteAName=$siteAName&siteBName=$siteBName&startTime=$startTime&endTime=$endTime" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date"
{ "returnCode":"1", "returnMsg" : "success", "content":{ "siteName": "北京总部", "siteId": 74031762543384, "allocateBandwidth":"100", "bandwidths":{ "timeStamp":[1638322140000,1638322200000], "timeData":["2021-10-31 22:05","2021-10-31 22:10"], "upStreamBandwidth":[12,15], "downStreamBandwidth":[89,92] } } }