This API is used to query cdn relay traffic data for specified dimensions. Users can use this API to query detailed channel relay traffic reports for the corresponding customer, including output date, peak time, bandwidth peak, total traffic, etc. This is very helpful for customers to gain a direct understanding of their own relay traffic usage.
| 파라미터 이름 | 설명 |
|---|---|
dateFromString | Start Time
1. The time format is 'yyyy-MM-dd'.
2. Cannot exceed the current date.
3. Up to the past 730 days of data can be obtained. |
dateToString | End time
1. The time format is 'yyyy-MM-dd'.
2. The end time must be greater than the start time.
3. If the end time greater than the current time, the current time is taken.
4. DateFrom and dateTo are both not provided, defaulting to query the current time; if only one is not provided, throw an exception.
5. Maximum query interval allowed: 30 days, that is the range between dateFrom and dateTo can not exceed 30 days. |
timezoneString | 1. Specify the time zone for both the query time range(dateFrom/dateTo) and the returned data.
2. Greenwich Mean Time Zone, the default time zone is GMT+08:00.
3. If you wish to specify a different time zone, you can append a time zone identifier, i.e. 'GMT+09:00' or 'GMT-10:00'. |
timeRoundingString | 기본값: up 선택 가능한 값:updown Rounds up or down a timestamp by a given time period. Only valid when the granularity is less than 1d(not including 1day)
1. 'up' denotes rounds up, eg: granularity=5m then 00:00:00 ~ 00:05:00 will be displayed as 00:05:00.
2. 'down' denotes rounds down, eg: granularity=5m then 00:00:00 ~ 00:05:00 will be displayed as 00:00:00.
3. if not specified, the result will be rounded up. |
domainString | Domains
1. Domain is not uploaded: Query all domain names of the account (More than 2000 domains will encounter error, you can contact technical support for adjustment).
2. Domain is uploaded: Up to 2000 domains are supported (you can contact technical support for adjustment).
3. For multiple domain, please separate them with a semicolon ';'. |
serviceTypeString | Service type of the acceleration domain
1. If not specified, it is considered as 'no restriction on service type.
2. For multiple Application server types, please separate them with a semicolon ';'. eg: 'web,web-https' |
billingRegionString | 선택 가능한 값:매개변수 값 보기 billing region of the Acceleration domain
1. If not specified, it is considered as 'no restriction on billing region.
2. For multiple billing regions, please separate them with a semicolon ';'. eg: 'cn;kr' |
granularityString | 기본값: 1d 선택 가능한 값:5m1h1d time granularity: the default granularity is one day.
- 5m: five minutes
- 1h: one hour
- 1d: one day |
groupByString | 선택 가능한 값:domain Group keywords
1. If not specified, result will be aggregated as default.
2. Passing in a keyword means that the details need to be displayed according to the values corresponding to the keyword dimension grouping (for example, passing in 'domain' means that the details are expanded according to domain). If an invalid value is specified, it will encounter an error.
3. Support passing multiple values, for multiple value please separate them with a semicolon ';', only support 'domain' grouping currently. |
| 파라미터 이름 | 설명 |
|---|---|
codeString | request status code |
messageString | request status description |
dataObject | response data |
reportObject | container for data information. |
typeString | 기본값: cdn-traffic-report-data The metric name |
dateFromString | Indicates the starting time of response data. The time format is yyyy-MM-dd. |
dateToString | Indicates the ending time of response data. The time format is yyyy-MM-dd. |
timezoneString | 기본값: GMT+08:00 Indicates the time zone for the returned data. Greenwich Mean Time Zone, the format is GMT+08:00 |
groupsList | List of data items. Each item contains fields as following: 'domain', 'flow', 'peakBandwidth', 'peakTime' |
domainString | the name of domain |
totalRelayTrafficString | Indicates the CDN-to-Client traffic volume in gigabytes. The value is accurate to 3 decimal places. |
peakBandwidthString | Indicates the peak bandwidth(5-minute granularity) of CDN-to-Client traffic volume in Mbps. 1.The value is accurate to 3 decimal places. 2.If granularity<=5m, no display in groups container objects |
peakTimeString | Indicates the time of peak bandwidth(5-minute granularity). |
itemList | List of data items.Each item contains fields as following: 'time', 'flow' |
timeString | Indicates the date and time 1. If the type is "5m", the timestamp format is "YYYY-MM-DD hh:mm:00", that means the period's end time. 2. If the type is "1h", the timestamp format is "YYYY-MM-DD hh:00:00", that means the period's start time. 3. If the type is "1d", the timestamp format is "YYYY-MM-DD 00:00:00", that means the period's start time. |
relayTrafficString | Indicates the CDN-to-Client traffic volume in gigabytes. The value is accurate to 3 decimal places. |
| 에러 코드(code) | 설명(message) | HTTP 상태 코드 | 설명 |
|---|---|---|---|
| 24001121 | Parameter not provided | 200 | Parameter not provided |
| 24001122 | The format of parameter is incorrect | 200 | The format of parameter is incorrect |
| 24001123 | The range of parameter is incorrect. | 200 | The range of parameter is incorrect. |
| 24001124 | Parameter authentication failed | 200 | Parameter authentication failed |
| 24001125 | Parameter data exceeds the limit | 200 | Parameter data exceeds the limit |
| 24001126 | domain does not exist | 200 | domain does not exist |
| 24001127 | domain is invalid | 200 | domain is invalid |
| 24001128 | Billing region is invalid | 200 | Billing region is invalid |
| 24001129 | The value of parameter is wrong | 200 | The value of parameter is wrong |
| 24001130 | The given customer does not exist | 200 | The given customer does not exist |
| 24002001 | Mysql querying encounter error | 200 | Mysql querying encounter 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://endpoint/cdn/traffic/relay" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/xml" \
-d '{"dateFrom":"2024-09-01","dateTo":"2024-09-01","domain":"a.com;b.com"}'{
"code": "0",
"message": "Success",
"data": {
"report": {
"type": "get-cdn-relay-traffic",
"dateFrom": "2024-09-01",
"dateTo": "2024-09-01",
"timezone": "GMT+07:00",
"groups": [
{
"domain": "a.com",
"totalRelayTraffic": "0.053",
"peakBandwidth": "0.246",
"peakTime": "2024-09-01 01:05:00",
"item": [
{
"time": "2024-09-01 01:00:00",
"relayTraffic": "0.000"
},
{
"time": "2024-09-01 01:05:00",
"relayTraffic": "0.009"
},
{
"time": "2024-09-01 01:10:00",
"relayTraffic": "0.005"
},
{
"time": "2024-09-01 01:15:00",
"relayTraffic": "0.005"
},
{
"time": "2024-09-01 01:20:00",
"relayTraffic": "0.005"
},
{
"time": "2024-09-01 01:25:00",
"relayTraffic": "0.003"
},
{
"time": "2024-09-01 01:30:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 01:35:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 01:40:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 01:45:00",
"relayTraffic": "0.003"
},
{
"time": "2024-09-01 01:50:00",
"relayTraffic": "0.003"
},
{
"time": "2024-09-01 01:55:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 02:00:00",
"relayTraffic": "0.004"
}
]
},
{
"domain": "b.com",
"totalRelayTraffic": "0.053",
"peakBandwidth": "0.246",
"peakTime": "2024-09-01 01:05:00",
"item": [
{
"time": "2024-09-01 01:00:00",
"relayTraffic": "0.000"
},
{
"time": "2024-09-01 01:05:00",
"relayTraffic": "0.009"
},
{
"time": "2024-09-01 01:10:00",
"relayTraffic": "0.005"
},
{
"time": "2024-09-01 01:15:00",
"relayTraffic": "0.005"
},
{
"time": "2024-09-01 01:20:00",
"relayTraffic": "0.005"
},
{
"time": "2024-09-01 01:25:00",
"relayTraffic": "0.003"
},
{
"time": "2024-09-01 01:30:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 01:35:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 01:40:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 01:45:00",
"relayTraffic": "0.003"
},
{
"time": "2024-09-01 01:50:00",
"relayTraffic": "0.003"
},
{
"time": "2024-09-01 01:55:00",
"relayTraffic": "0.004"
},
{
"time": "2024-09-01 02:00:00",
"relayTraffic": "0.004"
}
]
}
]
}
}
}