Query the minute-level edge bandwidth of multiple domains
Name | Description |
---|---|
dateFromString | Start time:
1.Start time: time format is yyyy-MM-ddTHH:mm:ss+08:00, for example, 2016-12-02T10:00:00+08:00 (December 2rd, 2016, 10:00 a.m., Beijing Time);
2.Not greater than the current time;
3.The most recent half-year (183 days) data can be obtained
|
dateToString | End time:
1.The time format is 2016-12-02T10:00:00+08:00
2.End time should be greater than start time. If the end time is greater than current time, current time will be used.
3.If both fields of dataFrom and dateTo are left empty, then data in the last 1 hours will be queried by default; if one field is filled and one is left empty, then exception will occur.
4.Maximum time range allowable for query: The default value is 1 hour, that is, the difference between dateFrom and dateTo cannot exceed 1 hour (you can contact technical support to adjust it, the maximum is 31 days)
|
dataIntervalString | Data granularity:
1. Support 1m (1 minute granularity),5m (5 minutes granularity)
2. The default value is 1m
|
*domainList | Domain:
1.The default upper limit of domains that can be entered is 20 (if you want to adjust, please, contact technical support);
2.Automatically filter out illegal domains (illegal domains will be filtered out, the query results only return the data of legitimate domains)
|
groupByString | The optional value of the grouping dimension is domain; if it is passed in, detailed data will be displayed according to this dimension; |
Name | Description |
---|---|
codeString | request result status code |
messageString | request result information |
dataList | |
domainString | Domain name. If you do not select domain name group Dimension, this field is a semicolon-separated string of all domain names. |
peakValueString | Peak Bandwidth,unit is Mbps,example(9811.21Mbps) |
peakTimeString | Time of peak bandwidth,example(2019-02-13 18:01) |
totalString | Edge total traffic,example(74099.91MB) |
bandwidthDataList | |
timestampString | Time: 1. When the data query granularity is 1m, then the format is yyyy-MM-dd HH:mm;
Each time slice value represents the value within the previous time granularity range. The first time slice of the day is yyyy-MM-dd 00:01, and the last one is (yyyy-MM-dd+1) 00:00;
2. Return the time slices that contained in start time and in end time.
|
valueString | Edge bandwidth,the unit is Mbps,keep 2 decimal places |
Error code(code) | Description(message) | HTTP status | Semantic |
---|---|---|---|
24102014 | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | This operation requires a body. Ensure that the body is present and the Content-Type header is set. |
24102013 | The accept header specified in your request is not acceptable. | 400 | The accept header specified in your request is not acceptable. |
24102002 | There was an error in the body of your HTTP request. | 400 | There was an error in the body of your HTTP request. |
24102006 | The date specified is invalid. | 400 | The date specified is invalid. |
24102007 | You cannot specify a period greater than xx minute(s). | 400 | You cannot specify a period greater than xx minute(s). |
24102021 | Date format error | 400 | Date format error |
24102008 | param:domain is null or invalid. | 400 | param:domain is null or invalid. |
24102008 | param:dataInterval is null or invalid. | 400 | param:dataInterval is null or invalid. |
24102008 | param:groupBy is null or invalid. | 400 | param:groupBy is null or invalid. |
24102019 | The request was rejected because the number of Domain(xx) exceeds the limit (xx). | 400 | The request was rejected because the number of Domain(xx) exceeds the limit (xx). |
24102500 | We encountered an internal error. Please try again. | 500 | We encountered an internal error. Please try again. |
#!/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` curl -i --url "https://api.cdnetworks.com/api/report/bandwidth/multi-domain/real-time/edge" \ -X "POST" \ -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", "groupBy":"domain"}'
{ "code":"0", "message":"success", "data":[ { "domain":"www.aaa.com", "peakValue":"1200.00", "peakTime":"2019-11-20 17:00", "total":"62000.00", "bandwidthData":[ { "timestamp":"2019-11-20 18:00", "value":"52.42" }, { "timestamp":"2019-11-20 19:50", "value":"5.39" } ] }, { "domain":"www.bbb.com", "peakValue":"1200.00", "peakTime":"2019-11-20 16:00", "total":"62000.00", "bandwidthData":[ { "timestamp":"2019-11-20 18:00", "value":"5.39" }, { "timestamp":"2019-11-20 19:50", "value":"5.39" } ] } ] }