Creating a Cache Preheating Task
Function
This API is used to create a cache preheating task.
URI
POST /v1.0/cdn/preheatingtasks
Table 1 lists the parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Enterprise project to which the cache refreshing task is added. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API. |
Request
Request parameters
Table 2 describes the request parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
urls |
Yes |
Array of strings |
Value example: http://abc.com/image/1.png. Use commas (,) to separate URLs from each other. Preheating for directories is not available yet. A single URL can contain a maximum of 10,240 characters. 1,000 URLs can be entered at a time. |
Example request
Requested path
{ "preheatingTask":{ "urls":[ "http://www.example1.com/index.html", "http://www.example2.com/web" ] } }
Response
Response parameters
Table 3 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
task_type |
String |
Type of a task. The value is either refresh or preheating. |
status |
String |
Task result. task_done indicates that the preheating task succeeded. task_inprocess indicates that the task is being preheated. |
processing |
Integer |
Number of URLs being processed. |
succeed |
Integer |
Number of URLs processed. |
failed |
Integer |
Number of URLs that failed to be processed. |
total |
Integer |
Total number of tasks. |
create_time |
Integer |
Time when the task is created, which is expressed as milliseconds since 1970-01-01 00:00:00 Coordinated Universal Time (UTC). |
urls |
Array of strings |
URLs that need to be prefetched. |
{ "preheatingTask" : { "id" : "ff8080*********************c6e", "status" : "task_inprocess", "processing" : 2, "succeed" : 0, "failed" : 0, "urls" : [ "http://www.example1.com/index.html", "http://www.example2.com/web" ], "task_type" : "preheating", "total" : 2, "create_time" : 0 } }
Status Codes
See Status Codes.
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot