网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案
按分钟粒度展示所有传入域名的带宽汇总明细
单用户调用频率:1500/5min
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
dateFrom | String | 否 | 开始时间: 1.时间格式为yyyy-MM-ddTHH:mm:ss+08:00,例如,2019-01-01T10:00:00+08:00(为北京时间2019年01月01日10点0分0秒); 2.不能大于当前时间 3.最多可获取最近半年(183天)的数据。 |
dateTo | String | 否 | 结束时间: 1.时间格式2016-12-02T10:00:00+08:00 2.结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间。 3.dateFrom,dateTo二者都未传,默认查询过去的1小时;如仅有一个未传,抛异常 4.允许查询最大时间间隔:1小时(可联系技术支持调整),即dateFrom和dateTo相差不能超过1小时。 |
domain | List | 是 | 域名: 1.可传递域名数量上限默认为20个(可联系技术支持调整); 2.自动过滤掉非法域名(如传递非法域名,会被过滤掉,查询结果只返回合法域名的数据) 3.域名超过上限,报错 |
dataInterval | String | 否 | 数据粒度:不传默认1m 1.支持1m(1分钟)、5m(5分钟) |
参数名称 | 类型 | 描述 |
---|---|---|
result | List | |
peakValue | String | 峰值带宽 Mbps,示例 (931556.21 Mbps) |
peakTime | String | 峰值时间,示例(2019-02-13 18:01); |
total | String | 边缘总流量,示例 ( 74099.92 MB ) |
bandwidthData | List | |
timestamp | String | 数据粒度为1分钟,格式为yyyy-MM-dd HH:mm; |
value | String | 边缘带宽值,单位Mbps,保留2位小数。 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
MissingBody | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | 请求体没有传递 |
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json和xml格式,默认为json格式 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
InvalidDatePeriod | The date specified is invalid. | 400 | dateFrom或dateTo不符合规范 |
DateSpanError | You cannot specify a period greater than 60 minute(s). | 400 | dateFrom和dateTo相差超过60分钟(1小时) |
PARAM_INVALID | param: domain is null or invalid. | 400 | 参数domain不符合规范 |
NumberLimitExceeded | The request was rejected because the number of domain({actual}) exceeds the limit ({expect}). | 400 | 传递的域名个数超过账号限制 |
PARAM_INVALID | param: dataInterval is null or invalid. | 400 | 参数dataInterval 不符合规范 |
InternalError | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
#!/bin/bash # Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response 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` curl -i --url "https://open.chinanetcenter.com/api/report/bandwidth/real-time/edge" \ -X "POST" \ -H "X-Time-Zone:GMT+08:00" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{"dateFrom": "2019-01-01T10:00:00+08:00","dateTo": "2019-01-01T11:00:00+08:00","domain": ["www.baidu1.com","www.baidu2.com"],"dataInterval": "1m" }'
{ "result": [ { "peakValue": "1200.00", "peakTime": "2019-02-15 00:08", "total": "62000.00", "bandwidthData": [ { "timestamp": "2019-02-15 00:00", "value": "133.33" }, { "timestamp": "2019-02-15 00:01", "value": "266.67" }, { "timestamp": "2019-02-15 00:02", "value": "400.00" }, { "timestamp": "2019-02-15 00:03", "value": "533.33" }, { "timestamp": "2019-02-15 00:04", "value": "666.67" }, { "timestamp": "2019-02-15 00:05", "value": "800.00" }, { "timestamp": "2019-02-15 00:06", "value": "933.33" }, { "timestamp": "2019-02-15 00:07", "value": "1066.67" }, { "timestamp": "2019-02-15 00:08", "value": "1200.00" }, { "timestamp": "2019-02-15 00:09", "value": "133.33" }, { "timestamp": "2019-02-15 00:10", "value": "266.67" }, { "timestamp": "2019-02-15 00:11", "value": "400.00" }, { "timestamp": "2019-02-15 00:13", "value": "666.67" }, { "timestamp": "2019-02-15 00:14", "value": "800.00" } ] } ] }