Get Top Files Report

To get the Top 50 files report, use the following request:

GET /cdn/reports/top_files.xml
GET /cdn/reports/top_files.json

XML Request Example

curl -i -X GET -u user:userpass --url http://onapp.test/cdn/reports/top_files.xml -d '<top_files><start_date>2016-11-09</start_date><end_date>2016-11-10</end_date><entity_id>945986057</entity_id></top_files>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

curl -i -X GET -u user:userpass --url http://onapp.test/cdn/reports/top_files.json  -d '{"top_files": {"start_date": "2016-11-09", "end_date": "2016-11-10", "entity_id": "945986057"}}' -H 'Accept: application/json' -H 'Content-type: application/json'

Where:

Define a time period by setting the following parameters:

  • start_date - the start date of the specific time period
  • end_date - the end date of the specific time period

Get statistics for a particular CDN resource by setting the following parameters:

  • entity_id - the ID of the CDN resource

XML Output Example

<top_files>
<top_fifty_files_table type="array">
<top_fifty_files_table>
<resourceId type="integer">422564898</resourceId>
<fileUrl>/test.gif</fileUrl>
<request type="float">113.0</request>
<hit type="float">110.0</hit>
<miss type="float">3.0</miss>
<bandwidth type="float">3781649.0</bandwidth>
</top_fifty_files_table>
</top_fifty_files_table>
</top_files>

Where:

resourceId - the ID of the CDN resource

fileUrl -  the URL of the resource file

request - the total amount of file requests for the selected period

hit - the amount of successful  file requests for the selected period

miss - the amount of failed  file requests for the selected period

bandwidth - the amount of transmitted bandwidth for the selected period