Content Acceleration,Media Acceleration VoD,Media Acceleration Live Broadcast
This API is used to query the traffic summary information for all domains under a user's account. Users provide start and end time parameters to obtain detailed traffic data. Through this API, users can understand and analyze the CDN traffic usage of all domains within the specified time period.
Single user trigger frequency: 300/5min
| Name | Description |
|---|---|
*datefromString | Start time 1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM; 2.Must be smaller than the current time and dateto; 3.Period between datafrom and dateto cannot be longer than 31 days |
*datetoString | End time
1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM;
2.Must be greater than 'datefrom';
3.if it's greater than the current time, then the current time is assigned as the value |
granularityString | Data granularity
1.fiveminutes: five minutes, hourly: one hour, daily: one day;
2.If not specified, daily is set as the default value;
3.If fiveminutes is specified as the value, then data is returned in actual configured granularity when there is a specific configuration on data collecting granularity for the custome |
| Name | Description |
|---|---|
totalTrafficString | Total traffic. Unit: MB, retain two decimals |
dataSeriesList | Traffic data |
timestampString | Time:
1.When the data query granularity is fiveminutes, the format is yyyy-MM-dd HH:mm; the data value of every time slice represents the data value within the previous time granularity range. The first time slice of the day is yyyy-MM-dd 00:05 AM, and the last one is yyyy-MM-dd 24:00.
2.When the data query granularity is hourly, the format is yyyy-MM-dd HH; the data value of every time slice represents the data 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 24.
3.When the data query granularity is daily, the format is yyyy-MM-dd; the data value of every time slice represents the value of the daily data.
4.Return the time slice contained in start time and the time slice contained in end time |
trafficString | Traffic. Unit: MB ,retain two decimals |
#!/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://api.atomile.com/api/report/traffic?datefrom=2017-11-07T00:00:00%2B00:00&dateto=2017-11-07T00:10:00%2B00:00&granularity=fiveminutes" \ -X "GET" \ -H "X-Time-Zone:GMT+00:00" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json"
{
"totalTraffic":"62.18",
"dataSeries":[
{
"timestamp":"2019-07-23 00:05:00",
"traffic":"31.47"
},
{
"timestamp":"2019-07-23 00:10:00",
"traffic":"30.7"
}
]
}