CDN Usage Statistics API
CDN usage statistics shows detailed information on all the resources used by CDN. To view the CDN usage statistics, use the following request:
GET /cdn_usage_statistics.xml
GET /cdn_usage_statistics.json
XML Request Example
curl -i -X GET -u user:userpass --url http://onapp.test/cdn_usage_statistics.xml -d '<period><startdate>YYYY-MM-DD+hh:mm:ss</startdate><enddate>YYYY-MM-DD+hh:mm:ss</enddate></period>' -H 'Accept: application/xml' -H 'Content-type: application/xml'
JSON Request Example
curl -i -X GET -u user:userpass --url http://onapp.test/cdn_usage_statistics.json -d '{"period":{"startdate":"YYYY-MM-DD+hh:mm:ss","enddate":"YYYY-MM-DD+hh:mm:ss"}}' -H 'Accept: application/json' -H 'Content-type: application/json'
XML Output Example
<cdn_stats> <cdn_stat> <user_id>1</user_id> <edge_group_id>6</edge_group_id> <cached>20411832</cached> <non_cached>1074815565</non_cached> <location_id>532</location_id> </cdn_stat> </cdn_stats>
Where:
user_id - the ID of the OnApp user
edge_group_id - the ID of the edge group in use
cached - the amount of cached data in bytes
non_cached - the amount of non-cached data in bytes
location_id - the ID of the location assigned to this particular edge group (edge_group_id) in OnApp.
You can view the list of locations via the Get CDN Edge Group Details API request, where available_locations parameter is the array of locations available for this edge group.