Last update:2022-10-14 15:24:42
This interface provides the function of packaging and compressing specified multiple files on the cloud storage platform. Currently only ZIP compression is supported.
POST /fmgr/compress
Host: <MgrDomain>
Authorization: <accessToken>
Parameter | Required | Description |
---|---|---|
HOST | Yes | Management domain name , which can be obtained in the user management interface |
Authorization | Yes | Manage Credentials |
Request parameters are organized in the following format and submitted as request content:
fops=bucket/<Urlsafe_Base64_Encoded_Bucket>/keys/<Urlsafe_Base64_Encoded_key1|Urlsafe_Base64_Encoded_key2|Urlsafe_Base64_Encoded_key3|……>/keyList/<Urlsafe_Base64_Encoded_keyList>/saveas/<Urlsafe_Base64_Encoded(<bucket:filekey>)>¬ifyURL=<Urlsafe_Base64_Encoded_notifyUrl>&separate=<Separate>&force=<Force>
Parameter | Required | Description |
---|---|---|
fops | Yes | The processing parameter list, the format is the above description, supports multiple processing requests at the same time, and the parameter lists are separated by ;. |
bucket | Yes | The storage space where the files to be compressed are located. <Urlsafe_Base64_Encoded_bucket> is the URL-safe Base64-encoded string for the specified bucket name. |
keys | Yes | The files or directories to be compressed, and resources are separated by ¦. Note: 1. If the keyList parameter exists, this parameter can be left blank. 2. Ending with / indicates that the key value is a directory. |
keyList | Yes | The index file path of the file or directory information to be compressed. When a large number of files or directories need to be compressed, the information to be compressed can be written into the index file line by line (without URL encoding), and then the index file is uploaded to the space. By specifying the path of the index file, the corresponding file and directory specified by the content of the index file can be compressed. . Note: If the keys parameter exists, this parameter can be left blank |
saveas | Yes | The path to save the output file. The parameter needs to be filled with “space:filename” URL-safe Base64 encoded value |
notifyURL | no | The processing result is notified of the receiving URL. For the format of the notification content, see the returned content of the task query interface . |
separate | no | Whether processing instructions are notified separately. Set 1 and 0 as option codes: 1: Indicates that notifyURL is notified after each command is executed. 0: Indicates that notifyURL is notified once after all commands are executed . The default value is 0. |
force | no | Whether to force processing. 1: Force data processing and overwrite the original result. 0: If the data processing result already exists, the processing is considered to be successful, and repeated processing is avoided to waste resources. The default value is 0. |
Note:
Example,test/keyList.txt have the information,the files as followings.
1.jpg
dir1/
2.jpg
test.jpg
……
Specified keyList为test/keyList.txt,showed as 1.jpg、dir1/、2.jpg、test.jpg、……” starting compress files.
test(directory)
|---test1(directory)
|---1.jpg(file)
|---test3(directory)
|---2.jpg
If the request is successful, a Json
string with the following content is returned:
{ "persistentId": <persistentId> }
Field name | Required | Description |
---|---|---|
persistentId | Yes | The task process ID, which can be used to query the task progress. |
If the request fails, a Json
string with the following content is returned:
{
"code": "<code string>",
"message": "<ErrMsg string>"
}
Field name | Required | Description |
---|---|---|
code | Yes | HTTP request response code, see [ HTTP response status code |
message | Yes | Request failed message |
curl -v -X POST -d "fops=bucket/bXlidWNrZXQ=/keys/MS5qcGc=|Mi5qcGc=|My5qcGc=/saveas/bXlidWNrZXQyOjEuemlw;bucket/bXlidWNrZXQ=/keyList/dGVzdC9jb21wcmVzcy50eHQ=/saveas/bXlidWNrZXQyOjIuemlw¬ifyURL=aHR0cDovL3Rlc3QuY29tL25vdGlmeVVSbA==&separate=1&force=0" -H "Authorization:86622e227a50d49d858c2494a935bc2e4ac543a7:Y2JmMGY0YTNhZmQxZmVlZGM2ZTA0YTdjNTcyOWQ1NjRkNTExYjg0Yg==" --url "http://mgrDomain/fmgr/compress"