Query the prefetch task status. Use this API to check global network has prefetch successfully.
パラメータ名 | 説明 |
---|---|
startTimeString | Query the start time of the task creation time, such as 2017-01-10 23:33:26. It is not allowed to query tasks before 7 days ago. |
endTimeString | Query the end time of the task creation time, such as 2017-01-10 23:33:26,. The query time is no more than 1 days from the start time. |
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 the submission is successful, the content management system will return an itemId in the response message. |
urlString | It is the url that you want to prefetch. This element only allows one url to be submitted per query. |
statusString | Task status. The system allows you to select a task status query. These states can be queried:
1.success
2.failure |
pageNoString | Request page number. The default is 1. |
pageSizeString | The number of pages displayed. The default is 20. |
パラメータ名 | 説明 |
---|---|
countInteger | The number of tasks that match the query criteria. If 10 tasks meet the query criteria, the value of count is 10. |
CodeInteger | The status code of the task creation result. 1 means success, 0 means failure. |
MessageString | Content system response message after submitting the task. |
pageNoInteger | The total number of pages for task query results. |
pageSizeInteger | How many purge task data is displayed per page. |
resultDetailList | Collection of task results. |
beginTimeString | The time at which the content management system begins to get the file. |
createTimeString | The time at which the content management system receive the request and creates a prefetch task. |
finishTimeString | The time at which cdn cache the file and the content management system completes the summary task results. |
rateString | The content management system handles the prefetch tasks's success rate. If the success rate is 98%, the value is 98. |
statusString | The status of the prefetch task. There are several states:
Success: Prefetch success.
Failure: Prefetch failed.
Wait: The prefetch task is waiting to be processed.
Run: The prefetch task is being executed. |
urlString | Prefetched file URL. |
エラーコード(code) | 説明(message) | HTTPステータスコード | 意味 |
---|---|---|---|
1 | success | 200 | success |
0 | parse json error | 200 | parse json error |
0 | username is invalid | 200 | username is invalid |
0 | startTime or endTime must not be empty | 200 | startTime or endTime must not be empty |
0 | query create time should not before 3 days | 200 | query create time should not before 3 days |
0 | query time error | 200 | query time error |
0 | endTime should not before startTime | 200 | endTime should not before startTime |
0 | page size error | 200 | page size error |
0 | page no error | 200 | page no error |
0 | task status error,eg: init wait run success failure | 200 | task status error,eg: init wait run success failure |
#!/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.cdnetworks.com/ccm/fetch/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",
"rate": "100",
"status": "success",
"url": "http: //vodtest.lxdns.com/testdsfsdf1"
},
{
"beginTime": "2017-01-11 16:17:03",
"createTime": "2017-01-11 16:17:03",
"finishTime": "2017-01-11 16:17:04",
"rate": "100",
"status": "success",
"url": "https://vodtest.lxdns.com/testdsfsdf1"
}
]
}