Extracts the specified files from a ZIP, RAR, or 7z package to the specified directory or decompresses the entire package.
Operation description
-
Before you call this operation, make sure that you are familiar with the billing of Intelligent Media Management (IMM).****
**
Note Asynchronous processing does not guarantee timely task completion.
-
The operation supports a package that contains up to 80,000 files.
-
The operation supports ZIP or RAR packages up to 200 GB in size, or 7z packages up to 50 GB in size.
-
The operation extracts files in streams to the specified directory. If the file extraction task is interrupted by a corrupt file, files that have been extracted are not deleted.
-
This operation is an asynchronous operation. After a task is executed, the task information is retained only for seven days and cannot be retrieved when the retention period elapses. You can call the GetTask or ListTasks operation to query information about the task.`` If you specify Notification , you can obtain information about the task based on notifications.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
imm:CreateFileUncompressionTask | create | *Project acs:imm:{#regionId}:{#accountId}:project/{#ProjectName} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ProjectName | string | Yes | immtest | |
CredentialConfig | CredentialConfig | No | If you have no special requirements, leave this parameter empty. The configurations of authorization chains. For more information, see Use authorization chains to access resources of other entities. | |
Password | string | No | The password that protects the package. | 123456 |
UserData | string | No | The custom information, which is returned in an asynchronous notification and facilitates notification management. The maximum length of the value is 2,048 bytes. | {"ID": "user1","Name": "test-user1","Avatar": "http://example.com?id=user1"} |
SelectedFiles | array | No | The files to extract. If you do not specify this parameter, the entire package is decompressed. | |
string | No | The path of the file to extract. The path is relative to the root directory of the package. | rar5/1.jpg | |
SourceURI | string | Yes | The OSS URI of the package. Specify the OSS URI in the oss://${Bucket}/${Object} format, where | oss://imm-apitest-fxf2/name.zip |
Notification | Notification | No | The notification settings. For information about the asynchronous notification format, see Asynchronous message examples. | |
TargetURI | string | No | The OSS URI to which you want to extract files from the package or decompress the entire package. Specify the OSS URI in the oss://${Bucket}/${Object} format, where | oss://test-bucket/test-dir/ |
If you want to obtain detailed information about the decompression task, specify the ExtendedMessageURI
parameter in Notification
. The object specified by this parameter contains task information organized in the following structure:
{
"Password" : "the password that protects the package.",
"IsEncryption": "indicates whether the package is password-protected. The value is true or false.",
"ArchiveFiles": [
{
"URI": "the URI of the extracted file. Example: oss://test-bucket/test-dir/test.txt",
"PathName": "the path of the file relative to the package. Example: ./test.txt",
"Reason": "the reason for a preview failure",
"IsFolder": "indicates whether the file is a directory. The value is true or false.",
"PackedSize": "the size of the file in the package.",
"UnPackedSize": "the size of the file after it is extracted from the package.",
"FileAccessTime": "the last access time of the file.",
},
{
"URI": "oss://test-bucket/test-dir/text.doc",
"PathName": "./text.doc",
"Reason": "",
"IsFolder": "true",
"PackedSize": "102",
"UnPackedSize": "150",
"FileAccessTime": "2023-07-21T09:46:35Z",
},
]
}
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "EC564A9A-BA5C-4499-A087-D9B9E76E*****",
"EventId": "0ED-1Bz8z71k5TtsUejT4UJ16Es*****",
"TaskId": "FileUncompression-16ab5dd6-af02-480e-9ed7-a8d51b1*****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-08-30 | The request parameters of the API has changed | View Change Details |
2023-04-03 | The request parameters of the API has changed | View Change Details |
2023-03-09 | The request parameters of the API has changed | View Change Details |