This API ranks channels by peak bandwidth. You can query data for a specified date or time range and filter the results by channel, region, ISP, acceleration type, and bandwidth data type. The response returns channels sorted by peak bandwidth, together with the peak time, peak bandwidth, and total traffic for each channel.
| Name | Description |
|---|---|
dateString | Specifies the query date. The date must be in the yyyy-MM-dd format. If this parameter is not specified or is empty, the current date is used by default. |
startdateString | Specifies the start date of the query range. This parameter must be used together with enddate. The format is yyyy-MM-dd. If date is specified, this parameter is ignored. |
enddateString | Specifies the end date of the query range. This parameter must be used together with startdate. The format is yyyy-MM-dd. If date is specified, this parameter is ignored. |
channelString | Specifies the channels to query. Separate multiple channel values with semicolons. If not specified, all channels of the queried account are used. |
regionString | Optional Value: Parameter Values Specifies the acceleration regions to query. Separate multiple region abbreviations with semicolons. For example, set region=cn;apac to query data for the China mainland and Asia-Pacific regions. If not specified, data for all regions is returned. |
ispString | Optional Value: Parameter Values Specifies the ISP abbreviations to query. Separate multiple ISP abbreviations with semicolons. This parameter takes effect only when region is set to cn. If not specified, data for all ISPs is returned. |
accetypeString | Specifies the acceleration types to query. Separate multiple acceleration types with semicolons. If this parameter is not specified or is set to all, data for all acceleration types is returned. |
dataformatString | Default value: xml Optional Value: xmljson Specifies the response format. Valid values are xml and json. The default value is xml. |
isExactMatchString | Specifies whether the channel values must be matched exactly. The default value is true. When set to true, each channel must be specified as a complete domain name. Invalid or duplicate channel values are filtered out. If all input channel values are invalid, the API returns HTTP 403. When set to a value other than true, the API returns data for all channels whose names end with any of the specified channel values. |
datatypeString | Default value: 1 Optional Value: 123 Specifies the data type. Valid values are '1', '2', and '3'. '1' indicates total bandwidth, '2' indicates HTTP bandwidth, and '3' indicates HTTPS bandwidth. The default value is '1'. The isp parameter is not supported when this parameter is set to '2' or '3'. |
timezoneString | Specifies the time zone in GMT offset format. For example, GMT%2B09:00 indicates GMT+09:00, and GMT-09:00 indicates GMT-09:00. If this parameter is not specified, GMT+08:00 is used by default. |
| Name | Description |
|---|---|
providerObject | Response data container |
nameString | Tenant name |
typeString | API type |
dateObject | Channel peak bandwidth data |
startdateString | Start date of the query range |
enddateString | End date of the query range |
channelPeakObject | Peak channel bandwidth data |
channelString | Channel name |
peakTimeString | Time at which the peak bandwidth occurred. |
peakValueString | Peak bandwidth, in Mbps |
totalFlowString | Total traffic, in GB |
peakAvgString | PeakAvg bandwidth, in Mbps |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| 403 | Invalid region, invalid channel, no channel is available, or the query time range exceeds the allowed limit. | 403 | Invalid region, invalid channel, no channel is available, or the query time range exceeds the allowed limit. |
| 500 | Internal error. | 500 | Internal error. |
#!/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/myview/bandwidth-peak-ranking" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/xml" \ -d "channel=test.com&startdate=2018-02-02&enddate=2018-02-03&dataformat=json"
{
"provider":{
"name":"${ProviderName}",
"type":"bandwidth-peak-ranking",
"date":{
"startdate":"2017-07-16",
"enddate":"2017-07-17",
"channelPeak":[
{
"channel":"a1.tv",
"peakTime":"2017-07-16 21:10:00",
"peakValue":"27573.23",
"totalFlow":"315149.94"
},
{
"channel":"a2.tv",
"peakTime":"2017-07-17 21:00:00",
"peakValue":"9588.45",
"totalFlow":"102876.86"
}
]
}
}
}