Creating a Cache Refreshing Task
Function
This API is used to create a cache refreshing task.
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 |
---|---|---|---|
type |
No |
String |
Type of cached content to be purged. The value is either file or directory. The default value is file. |
urls |
Yes |
Array of strings |
Value example: http://abc.com/image/1.png. Use commas (,) to separate URLs from each other. A single URL can contain a maximum of 10,240 characters. A maximum of 1,000 URLs can be entered at a time. |
Example request
Requested path
{ "refreshTask":{ "type":"file", "urls":[ "http://www.example.com/index.html", "http://www.example.com/web" ] } }
Response
Response parameters
Table 3 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
task_type |
String |
Task type. The value is either refresh or preheating. |
status |
String |
Task result. task_done indicates that the refreshing task succeeded. task_inprocess indicates that the refreshing task is being processed. |
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 purged. |
{ "refreshTask" : { "id" : "ff808***********************2b35", "status" : "task_inprocess", "processing" : 2, "succeed" : 0, "failed" : 0, "urls" : [ "http://www.example1.com/index.html", "http://www.example2.com/web" ], "task_type" : "refresh", "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