All Products
Search
Document Center

:UploadFile

Last Updated:Jan 16, 2025

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

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
esa:UploadFilecreate
*Site
acs:esa:{#regionId}:{#accountId}:site/{#SiteId}
    none
none

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.