Content MGMT
Query the purge task status. Use this API to check if the task has been completed successfully throughout the global CDN.
Single user trigger frequency: 10/5min
| Name | Description |
|---|---|
startTimeString | Start time of task creation,The format is yyyy-MM-dd HH:MM:ss; For example 2017-01-10 06:33:26,Can only query refresh tasks within 3 days. |
endTimeString | End time of task creation,The format is yyyy-MM-dd HH:MM:ss; For example 2017-01-10 06:33:26 |
itemIdString | A unique identifier for the same batch of tasks. If you submit multiple URLs from an API request, the ID is a unique number for these tasks.Query tasks by batch, such as submitting 10 url refreshes at a time. After successful submission, the content management system will return an itemId in the response message. |
urlString | The cached url needs to be refreshed (url type could be directory, regular file, tag, and common file), and a single call allows only one url to be entered |
statusString | Task status. The system allows you to select a task status query. These states can be queried:
success: Purge success.
failure: Purge failed.
wait: The purge task is waiting to be processed.
run: The purge task is being executed. |
pageNoInteger | Request page number. The default is 1. |
pageSizeInteger | The number of pages displayed. The default is 20. |
| Name | Description |
|---|---|
countInteger | The number of results for this query, count for 10 if 10 tasks are eligible for a query |
CodeInteger | After the task commits, the system's response code:
1) 0 means failure
2) 1 means success |
MessageString | System response message after task submit. |
pageNoInteger | Total page count of task query results |
pageSizeInteger | How many refresh task data per page |
resultDetailList | Set of task results |
beginTimeString | Time for content management system to start cache refresh task |
createTimeString | Time the content management system creates a cache refresh task |
finishTimeString | Content management system executes and summarizes the completion time of cache refresh tasks |
rateString | Success rate for performing cache refresh tasks, such as 98%, the value is 98 |
statusString | Cache refresh task execution status, which has the following states:
1) success: Indicates that the task that refreshes the file cache has performed successfully
2) failure: Indicates that the task that refreshes the file cache has performed failed
3) wait: Indicates that the task of refreshing the cache is in the queue
4) run: Indicates that the task of refreshing the cache is in progress |
urlString | Refresh the cache of a file or directory. |
isDirInteger | The operation type of the purge task:
1) 0: Refresh a specific file
2) 1: regular file
3) 2: Refresh all files in a directory
4) 3: Refresh a tag |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| 0 | The end time of the query cannot be earlier than the start time | 200 | The end time of the query cannot be earlier than the start time |
| 0 | Page number cannot be negative | 200 | Page number cannot be negative |
| 0 | Page size cannot be negative or greater than 1000 | 200 | Page size cannot be negative or greater than 1000 |
| 0 | Error resolving json | 200 | Error resolving json |
| 0 | Querying tasks up to 3 days ago is not allowed | 200 | Querying tasks up to 3 days ago is not allowed |
| 0 | Error in time format | 200 | Error in time format |
| 0 | Start time or end time not allowed to be empty | 200 | Start time or end time not allowed to be empty |
| 1 | Success | 200 | Success |
| 0 | Error in the status of the query | 200 | Error in the status of the query |
| 0 | Invalid user name (user name is empty or user name is not allowed to push) | 200 | Invalid user name (user name is empty or user name is not allowed to push) |
#!/bin/bash
username="username"
apiKey='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/ccm/purge/ItemIdQuery" \
-X "POST" \
-u "$username:$password" \
-H "Date:$date" \
-H "Content-Type: application/json" \
-d '{
"startTime":"2017-05-01 00:00:00",
"endTime":"2017-05-02 23:59:59",
"itemId":"3ff59d129a2c40a39b9be8c9de9975d6",
"url":"https://www.test.com/test/test.jpg",
"status":"success",
"pageNo":1,
"pageSize":20
}'HTTP/1.1 200 OK
Content-Type: charset=utf-8; charset=UTF-8
x-cnc-request-id: 23f9abf8-1f4a-498c_1493668625478
Server: xxx
Content-Length: 1355
{
"count": 282,
"Code": 1,
"Message":"success",
"pageNo": 1,
"pageSize": 20,
"resultDetail": [
{
"beginTime": "2017-01-11 16:17:03",
"createTime": "2017-01-11 16:17:03",
"finishTime": "2017-01-11 16:17:04",
"isDir":0,
"rate": "100",
"status": "success",
"url": "http: //www.abc.com/testdsfsdf1"
},
{
"beginTime": "2017-01-11 16:17:03",
"createTime": "2017-01-11 16:17:03",
"finishTime": "2017-01-11 16:17:04",
"isDir":1,
"rate": "100",
"status": "success",
"url": "http: //www.abc.com/test/"
}
]
}