All Products
Search
Document Center

:UploadFile

Last Updated:Dec 26, 2024

Uploads the file that contains resources to be purged or prefetched.

Operation description

Note
  • The file can be up to 10 MB in size.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
SiteIdlongYes

The website ID. You can call the ListSites operation to obtain the ID.

123456789****
UrlstringYes

The OSS URL of the file that contains resources to be purged or prefetched.

https://xxxxx.oss-cn-shenzhen.aliyuncs.com/test_oss_file?Expires=1708659191&OSSAccessKeyId=**********&Signature=**********
TypestringYes

The type of the purge or prefetch task. Valid values:

  • file (default): purges the cache by file.
  • preload: prefetches the file.
  • directory: purges the cache by directory.
  • ignoreParams: purges the cache by URL with specified parameters ignored.
file
UploadTaskNamestringYes

The name of the upload task.

purge_task_2024_11_11

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F
UploadIdlong

The ID of the file upload task. You can use this ID for task submission or query subsequently.

159253299357****

Examples

Sample success responses

JSONformat

{
  "RequestId": "3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F",
  "UploadId": 0
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidTimeThe query time cannot exceed the last 3 days.The query time cannot exceed the last 3 days.
400MissingParameter.ObjectTypeThe ObjectType parameter is required if DomainName or ObjectType is specified.Specify the ObjectType parameter.
400InvalidParametersThe specified parameters are invalid.Parameter is illegal.
400ExceedFileUploadThe size of the uploaded file exceeds the upper limit. Select a file less than 10 MB.The size of the uploaded file exceeds the upper limit. Select a file less than 10 MB.
400TooManyRequestsToo many requests.Please try again later.Requests are too frequent, please try again later.

For a list of error codes, visit the Service error codes.