Queries the status of refresh or prefetch tasks that belong to an accelerated domain name.

Note
  • You can query the status of tasks by task ID or URL.
  • You can set both the TaskId and ObjectPath parameters. If you do not set the TaskId or ObjectPath parameter, data entries on the first page (20 entries) collected within the last three days are returned.
  • You can query data collected within the last three days.
  • If auto CDN cache update is enabled in the Object Storage Service (OSS) console, you cannot call the DescribeRefreshTasks operation to query automatic refresh tasks in OSS.
  • You can call this operation up to 10 times per second per account. If you want to query tasks at a higher frequency, call the DescribeRefreshTaskById operation. This operation allows you to query tasks by task ID.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeRefreshTasks

The operation that you want to perform. Set this parameter to DescribeRefreshTasks.

TaskId String No 1234321

The ID of the task that you want to query.

ObjectPath String No http://example.com/1.txt

The path of the object. The path is used as a condition for exact matching.

PageNumber Integer No 1

The number of the page to return. Valid values: 1 to 100000.

ObjectType String No file

The type of the task. Valid values:

  • file: refreshes one or more files.
  • directory: refreshes files under the specified directories.
  • regex: refreshes content based on a regular expression.
  • preload: prefetches one or more files.
Note If you set the DomainName or Status parameter, you must also set the ObjectType parameter.
DomainName String No example.com

The accelerated domain name. You can specify only one accelerated domain name in each call. By default, this operation queries the status of tasks for all accelerated domain names.

Status String No Complete

The status of the task. Valid values:

  • Complete: The task has completed.
  • Refreshing: The task is running.
  • Failed: The task failed.
PageSize Integer No 20

The number of entries to return on each page. Default value: 20. Maximum value: 100. Valid values: 1 to 100.

StartTime String No 2017-12-21T08:00:00Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

EndTime String No 2017-12-22T08:00:00Z

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note The end time must be later than the start time.
ResourceGroupId String No rg-acfmyuji4b6r4**

The ID of the resource group.

Response parameters

Parameter Type Example Description
RequestId String 174F6032-AA26-470D-B90E-36F0EB205BEE

The ID of the request.

PageNumber Long 10

The page number of the returned page.

PageSize Long 1

The number of entries returned per page.

TotalCount Long 2

The total number of entries returned.

Tasks Array of CDNTask

The details about the task.

CDNTask
Status String Complete

The status. Valid values:

  • Complete: The task has completed.
  • Refreshing: The task is running.
  • Failed: The task failed.
  • Pending: The task is pending.
CreationTime String 2014-11-27T08:23:22Z

The time when the task was created. The time is displayed in UTC.

ObjectType String file

The type of the task.

  • file: refreshes one or more files.
  • directory: refreshes files under the specified directories.
  • regex: refreshes content based on a regular expression.
  • preload: prefetches one or more files.
Process String 100%

The progress of the task, in percentage.

Description String Internal Error

The type of the error returned when the refresh or prefetch task failed. Valid values:

  • InternalError: An internal error occurred.
  • OriginTimeout: The response from the origin server timed out.
  • OriginReturn StatusCode 5XX: The origin server returned a 5XX error.
ObjectPath String http://example.com/1.txt

The URL of the object to be refreshed.

TaskId String 704225667

The ID of the task.

Examples

Sample requests

http(s)://cdn.aliyuncs.com/?Action=DescribeRefreshTasks
&ObjectPath=http://example.com/1.txt
&PageNumber=1
&PageSize=10
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<Tasks>
    <CDNTask>
        <CreationTime>2014-11-27T08:23:22Z</CreationTime>
        <ObjectPath>http://example.com/1.txt</ObjectPath>
        <Status>Complete</Status>
        <TaskId>704225667</TaskId>
        <ObjectType>file</ObjectType>
        <Process>100%</Process>
    </CDNTask>
    <CDNTask>
        <CreationTime>2014-11-27T08:18:38Z</CreationTime>
        <ObjectPath>http://aliyundoc.com/1.txt</ObjectPath>
        <Status>Complete</Status>
        <TaskId>704222904</TaskId>
        <ObjectType>file</ObjectType>
        <Process>100%</Process>
    </CDNTask>
</Tasks>
<PageNumber>1</PageNumber>
<PageSize>10</PageSize>
<TotalCount>2</TotalCount>
<RequestId>174F6032-AA26-470D-B90E-36F0EB205BEE</RequestId>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Tasks" : {
    "CDNTask" : [ {
      "CreationTime" : "2014-11-27T08:23:22Z",
      "ObjectPath" : "http://example.com/1.txt",
      "Status" : "Complete",
      "TaskId" : "704225667",
      "ObjectType" : "file",
      "Process" : "100%"
    }, {
      "CreationTime" : "2014-11-27T08:18:38Z",
      "ObjectPath" : "http://aliyundoc.com/1.txt",
      "Status" : "Complete",
      "TaskId" : "704222904",
      "ObjectType" : "file",
      "Process" : "100%"
    } ]
  },
  "PageNumber" : 1,
  "PageSize" : 10,
  "TotalCount" : 2,
  "RequestId" : "174F6032-AA26-470D-B90E-36F0EB205BEE"
}

Error code

HttpCode Error code Error message Description
429 TooManyRequests The server is busy. Please try again later. The error message returned because the server is unavailable. Try again later.

For a list of error codes, visit the API Error Center.