Cache managing
Preloading or deleting files from cache as well as whole cache deletion.
These operations are performed asynchronously and their response contains task_id. You can check status of the task using task_id (described below).
Attention!
You can make no more than 125 API requests per minute for cache management.
Delete file
URL: https://api.cdnvideo.ru/app/cache/v2/objects?cdn_url=http://<domain>/path/to/file
Either the dedicated CDN domain or CNAME can be set as <domain>.
- Method: DELETE
- Headers: CDN-AUTH-TOKEN
- Response Data Type: JSON Object
Query string parameters:
Parameter name | Value Type | Required |
---|---|---|
cdn_url | Text | Yes |
Possible response codes:
Status Code | Response Data | Response Format | Description |
---|---|---|---|
202 | task_id: type string | JSON | OK |
400 | None | None | Bad Request |
401 | None | None | Access Denied |
503 | None | None | Service Unavailable |
Request example
curl -X DELETE \ -H "CDN-AUTH-TOKEN: $TOKEN" \ 'https://api.cdnvideo.ru/app/cache/v2/objects?cdn_url=http://lajjncnn6d.a.trbcdn.net/aloha/cdn/sample_03.flv'
Successful response example
{ "task_id": "f0f9601e75b2415db0e2219ea07d8fde" }
Delete whole cache
URL: https://api.cdnvideo.ru/app/cache/v2/objects?cdn_url=http://<domain>/path/to/file&all
Either the dedicated CDN domain or CNAME can be set as <domain>.
- Method: DELETE
- Headers: CDN-AUTH-TOKEN
- Response Data Type: JSON Object
Query string parameters:
Parameter name | Value Type | Required |
---|---|---|
cdn_url | Text | Yes |
all | No value | Yes |
Possible response codes:
Status Code | Response Data | Response Format | Description |
---|---|---|---|
202 | task_id: type string | JSON | OK |
400 | None | None | Bad Request |
401 | None | None | Access Denied |
503 | None | None | Service Unavailable |
Request example
curl -X DELETE \ -H "CDN-AUTH-TOKEN: $TOKEN" \ 'https://api.cdnvideo.ru/app/cache/v2/objects?cdn_url=http://lajjncnn6d.a.trbcdn.net/aloha/cdn/sample_03.flv&all'
Successful response example
{ "task_id": "ccf82df380a34fe7a4992ca810ccfee4" }
Preload file
URL: https://api.cdnvideo.ru/app/cache/v2/objects?cdn_url=http://origin:port/path/to/file'
- Method: PUT
- Headers: CDN-AUTH-TOKEN
- Response Data Type: JSON Object
Query string parameters:
Parameter name | Value Type | Required |
---|---|---|
cdn_url | Text | Yes |
Possible response codes:
Status Code | Response Data | Response Format | Description |
---|---|---|---|
202 | task_id: type string | JSON | OK |
400 | None | None | Bad Request |
401 | None | None | Access Denied |
503 | None | None | Service Unavailable |
Request example
curl -X PUT \ -H "CDN-AUTH-TOKEN: $TOKEN" \ 'https://api.cdnvideo.ru/app/cache/v2/objects?cdn_url=http://cache-cdntest.cdnvideo.ru/aloha/cdn/sample_03.flv'
Successful response example
{ "task_id": "7a14702e80ec4b99ba5792ca9d781b3d" }
Check status of task
URL: https://api.cdnvideo.ru/app/cache/v2/tasks?id=<task_id>
- Method: GET
- Headers: CDN-AUTH-TOKEN
- Response Data Type: JSON Object
Possible response codes:
Status Code | Response Data | Response Format | Description |
---|---|---|---|
200 | task_description: type string, status: type string, date_started: type string, message: type string | JSON | OK |
400 | None | None | Bad Request |
401 | None | None | Access Denied |
404 | None | None | Not Found |
503 | None | None | Service Unavailable |
Request example
curl -X GET \ -H "CDN-AUTH-TOKEN: $TOKEN" \ 'https://api.cdnvideo.ru/app/cache/v2/tasks?id=7a14702e80ec4b99ba5792ca9d781b3d'
Successful response example
{ "task_description": "PRELOAD http://cache-cdntest.cdnvideo.ru/aloha/cdn/sample_03.flv", "status": "completed", "date_started": "2018-11-27T09:55:11", "message": "" }