Queries the status information about refresh or prefetch tasks. The maximum time range for a query is three days.

Note
  • You can query the status information by task ID or URL.
  • You can set both the TaskId parameter and the ObjectPath parameter to query. If you set neither the TaskId parameter nor the ObjectPath parameter, the data within the last three days on the first page is returned. By default, a maximum of 20 entries can be displayed on each page.
  • If you set the DomainName or Status parameter, you must also set the ObjectType parameter.

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 DescribeDcdnRefreshTasks

The operation that you want to perform. Set the value to DescribeDcdnRefreshTasks.

TaskId String No 704225667

The ID of the task. A task ID is assigned when you create a refresh or prefetch task.

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

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

PageNumber Integer No 2

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

ObjectType String No file

The type of task.

  • file: URL-based refresh.
  • directory: directory-based refresh.
  • preload: URL-based prefetch.

If you set the DomainName or TaskStatus parameter, you must also set this parameter.

DomainName String No example.com

The accelerated domain name. You can specify only one domain name in each call.

Status String No Complete

The status of the task to be queried.

  • Complete: The task is completed.
  • Refreshing: The task is in progress.
  • Failed: The task failed.
PageSize Integer No 20

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

StartTime String No 2017-01-01T12:12:20Z

The start 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-01-01T12:13:20Z

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.

Response parameters

Parameter Type Example Description
PageNumber Long 2

The page number of the returned page.

PageSize Long 2

The number of entries returned on each page.

RequestId String 174F6032-AA26-470D-B90E-36F0EB205BEE

The ID of the request.

Tasks Array of Task

The returned list of tasks.

Task
CreationTime String 2014-11-27T08:23:22Z

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

Description String Internal Error

The type of error returned when the refresh or prefetch task has failed.

  • 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://aaa.com/1.txt

The path of the object.

ObjectType String file

The type of task.

  • file: URL-based refresh
  • path: directory-based refresh
  • preload: URL-based prefetch
Process String 10

The progress of the task in percentile.

Status String Complete

The status of the task. Valid values:

  • Complete: The task is completed.
  • Refreshing: The task is in progress.
  • Failed: The task failed.
  • Pending: The task is pending.
TaskId String 123

The ID of the task.

TotalCount Long 20

The number of returned tasks.

Examples

Sample requests

https://dcdn.aliyuncs.com?Action=DescribeDcdnRefreshTasks
&ObjectPath=http://aaa.com/1.txt
&PageNumber=1
&PageSize=10
&<Common request parameters>

Sample success responses

XML format

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

JSON format

{
    "Tasks" : {
        "Task" : [{
                "CreationTime" : "2014-11-27T08:23:22Z",
                "ObjectPath" : "http://aaa.com/1.txt",
                "Status" : "Complete",
                "TaskId" : "704225667",
                "ObjectType" : "file",
                "Process" : "100%"
            }, {
                "CreationTime" : "2014-11-27T08:18:38Z",
                "ObjectPath" : "http://bbb.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

HttpCode Error code Error message Description
400 InvalidTaskId.Malformed The specified TaskId is invalid. The error message returned because the specified task ID is invalid. Specify a valid task ID.
400 MissingParameter.ObjectType The ObjectType parameter is required if DomainName or ObjectType is specified. The error message returned because the ObjectType parameter must be specified.
400 MissingTimeParameter The StartTime and EndTime must be both specified. The error message returned because the StartTime and EndTime parameters must be specified together.
400 InvalidEndTime.Mismatch The specified EndTime is earlier than the StartTime. The error message returned because the specified end time is earlier than the specified start time.
400 DomainNameOverLimit A maximum of 500 domains are supported for each request. The error message returned because the number of the specified domain names exceeds the upper limit (500). Send the request again after you specify a valid value.
400 InvalidStartTime.Malformed The specified StartTime parameter is invalid. The error message returned because the format of the specified start time is invalid. Specify a valid start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
400 InvalidEndTime.Malformed The specified EndTime is invalid. The error message returned because the format of the specified end time is invalid. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
400 InvalidStartTime.ValueNotSupported The specified StartTime is invalid. The error message returned because the specified value of the StartTime parameter is not supported. Specify a valid value.
400 InvalidObjectType.ValueNotSupported The specified ObjectType is not supported. The error message returned because the specified ObjectType parameter is invalid. Specify a valid value.
400 InvalidStatus.ValueNotSupported The specified Status is not supported. The error message returned because the specified Status parameter is invalid. Specify a valid value.

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