You can call the DescribeRefreshTasks operation to query the status information for refresh or preload tasks.

  • You can query the status information by task ID or URL.
  • If you do not specify the TaskId or ObjectPath parameters, the data within the last three days on the first page is returned. By default, one page displays a maximum of 20 entries.
  • You can specify both the TaskId and ObjectPath parameters.
  • If you specify the DomainName or TaskStatus parameter, you must also specify the ObjectType parameter.
  • You can only query data within the last three days.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String  Yes The operation that you want to perform. Set this parameter to DescribeRefreshTasks.
TaskId String No The ID of the task to be queried.
ObjectPath String No The path of the object, which is used as a condition for exact match.
DomainName String No The name of the CDN domain.
ObjectType String No The type of the task. Valid values:
  • file
  • directory
  • preload
If you specify the DomainName or TaskStatus parameter, you must also specify the ObjectType parameter.
Status String No The status of the task. Valid values:
  • Complete
  • Refreshing
  • Failed
StartTime String No The beginning of the time range where the data is queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format, for example, 2017-01-01T12:12:20Z.
EndTime String No The beginning of the time range where the data is queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format, for example, 2017-01-01T12:12:20Z.
PageSize Integer No The maximum number of entries to return on each page. Default value: 20. Valid values: 1 and 50.
PageNumber Integer No The number of the page to return. Valid values: 1 to 100000.

Response parameters

Parameter Type Description
Tasks Struct The detailed information about the tasks returned.
PageSize Integer The maximum number of entries that can be returned on each page.
PageNumber Integer The number of the page returned.
TotalCount Integer The total number of entries returned.

Parameters in TaskItem

Parameter Type Description
TaskId String The ID of the task.
ObjectPath String The path of the object.
Status String The status of the task.
  • Complete
  • Refreshing
  • Failed
  • Pending
Process String The progress, in percentage, of the task.
ObjectType String The type of the task.
  • file
  • path
  • preload
CreationTime DateTime The time when the task was created. The time is displayed in UTC.
Description String The type of the error returned when the refresh or preload task has failed.
  • Internal Error
  • Origin Timeout
  • Origin Return StatusCode 5XX

Examples

Sample request

https://cdn.aliyuncs.com?&Action=DescribeRefreshTasks&ObjectPath=&PageNumber=1&PageSize=10&<Common request parameters>

Sample success response

JSON format

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

Error codes

Error code Error message HTTP status code Description
Throttling Request was denied due to request throttling. 503 The error message returned because the request was denied due to throttling.
OperationDenied Your account does not open CDN service yet. 403 The error message returned because CDN has not been activated for your account.
OperationDenied Your CDN service is suspended. 403 The error message returned because CDN has been suspended for your account.
InvalidTaskId.Malformed Specified TaskId is malformed. 400 The error message returned because the specified TaskId parameter is invalid.