All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

GetRefreshOrPreloadTask

Last updated:2021-03-17 11:08:58

GetRefreshOrPreloadTask

Description

You can call this operation to query the progress and status of URL refresh, directory refresh, or prefetch tasks and check whether the tasks take effect globally.

  • You can query data by task ID, domain name, or URL.
  • You can query data by start time and end time. Both the start time and end time must be specified.
  • If no parameter is specified, the data of the current day is queried and up to 20 data records on the first page are returned by default.
  • Up to 5,000,000 data records can be returned for each query. If over 100,000 data records are available, the total count is displayed as 100,000. You can query more data records by specifying the page number.
  • You can specify the start time, end time, task ID, domain name, and URL at the same time. They are in AND relationships.
  • You can query only data of the last seven days.
  • Scenarios:

    • The Kingsoft Cloud CDN console calls this operation to query the progress and status of URL refresh, directory refresh, or prefetch tasks and check whether the tasks take effect globally. Then, the Kingsoft Cloud CDN console displays the results to users.
    • A user calls this operation to query the progress and status of URL refresh, directory refresh, or prefetch tasks and check whether the tasks take effect globally.
  • Note:

    • This operation supports only the POST request method.

Request syntax

The API request contains the specified directory /2016-09-01/content/GetRefreshOrPreloadTask, common request headers, and operation-specific request parameters. For more information, see the sample request.

Request parameters

Parameter Required Type Description
StartTime No String The beginning of the time range to query. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm+0800 format. The time must be in UTC+8. Example: 2016-08-01T21:14+0800.
EndTime No String The end of the time range to query. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm+0800 format. The time must be in UTC+8. The end time must be later than the start time. Example: 2016-08-01T21:14+0800.
TaskId No String The ID of the task. You can specify only one ID at a time.
DomainName No String The domain name. You can specify only one domain name at a time.
Urls No Url[] The array of URLs. You can query data by exact URL.
PageSize No Long The number of entries to return on each page. Default value: 20. Valid values: 1 to 50.
PageNumber No Long The number of the page to return. Default value: 1. Valid values: 1 to 100000.

Url

Parameter Required Type Description
Url Yes String The URL to be queried.

Response parameters

Parameter Type Description
StartTime String The beginning of the time range that is queried.
EndTime String The end of the time range that is queried.
Urls Url[] The URLs that are queried.
PageSize Long The number of entries returned per page.
PageNumber Long The page number of the returned page.
TotalCount Long The total number of URLs.
Datas UrlData[] The progress and status of the refresh or prefetch task.

Url

Parameter Type Description
Url String The URL to be queried.

UrlData

Parameter Type Description
Type String The type of the task. Valid values: refresh and preload.
Url String The URL to be refreshed or prefetched.
Progress Double The progress of the refresh or prefetch task.
Status String The status of the refresh or prefetch task. Valid values: success, progressing, and failed.
TaskId String The ID of the task. You can query the progress and status of a refresh or prefetch task by task ID.
CreateTime String The time when the task was created.

Examples

Sample request

POST method:

POST /2016-09-01/content/GetRefreshOrPreloadTask
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: RefreshCaches
x-version: 2016-09-01
Content-Type:application/json
Accept:application/json

{
    "Urls": [{
            "Url": "http://test0905.huanfou.net.cn/1.html"
        },
        {
            "Url": "http://ms.yhtest.huanfou.net.cn/1.html"
        }
    ]
}

Sample response

{
    "StartTime": "2019-10-14T19:54+0800",
    "EndTime": "2019-10-21T19:54+0800",
    "Urls": [{
            "Url": "http://test0905.huanfou.net.cn/1.html"
        },
        {
            "Url": "http://ms.yhtest.huanfou.net.cn/1.html"
        }
    ],
    "PageSize": 20,
    "PageNumber": 1,
    "TotalCount": 2,
    "Datas": [{
            "Type": "preload",
            "Url": "http://test0905.huanfou.net.cn/1.html",
            "Progress": 100.0,
            "Status": "failed",
            "TaskId": "4c48efa2ba244266a73cdd438ad7b764",
            "CreateTime": "2019-10-21T16:55+0800"
        },
        {
            "Type": "preload",
            "Url": "http://ms.yhtest.huanfou.net.cn/1.html",
            "Progress": 100.0,
            "Status": "failed",
            "TaskId": "4c48efa2ba244266a73cdd438ad7b764",
            "CreateTime": "2019-10-21T16:55+0800"
        }
    ]
}
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback