This topic describes how to run the listpart command to list the parts of an object for which the multipart upload task is incomplete.
Usage notes
To list parts, you must have the
oss:ListParts
permission. For more information, see Attach a custom policy to a RAM user.For ossutil 1.6.16 and later, you can directly use ossutil as the binary name in the command line. You do not need to update the binary name based on the operating system. For ossutil whose version is earlier than 1.6.16, you need to refresh the binary name based on the operating system. For more information, see ossutil command reference.
For more information about multipart uploads, see Multipart upload.
Command syntax
ossutil listpart oss://bucketname/objectname uploadid
The following table describes the preceding parameters.
Parameter | Description |
bucketname | The name of the bucket in which the parts that you want to list are stored. |
objectname | The name of the object for which the multipart upload task is incomplete. |
uploadid | The upload ID that identifies the multipart upload task. The upload ID is returned when you initiate the multipart upload task. You can use the upload ID to perform multipart upload operations, such as canceling and querying the multipart upload task. |
You can use the -m
option in the ls command to query part information, such as the object whose multipart upload task is not completed, the time when a multipart upload task was initiated, and the upload ID. For more information, see ls.
Examples
You can run the following command to list the parts of the exampleobject.txt object for which the multipart upload task is incomplete in the examplebucket bucket:
ossutil listpart oss://examplebucket/exampleobject.txt 89A46B10E94A4ED5A7E9869F9409****
The following sample output provides an example of part information, including the number of parts, ETags, and part size.
PartNumber Etag Size(Byte) LastModifyTime
2 "BD106FED29B349A635BE289746DB****" 4443891 2021-07-21 09:01:33
3 "25DA5C7BB933DBD732B6C11111EB****" 4443891 2021-07-21 09:01:31
4 "AFDA91A8D4F476BAC972306873A3****" 4443891 2021-07-21 09:01:31
11 "2FFEE8D5049AB059D7EC801927BB****" 4443891 2021-07-21 09:01:32
total part count:4 total part size(MB):16.95
0.101978(s) elapsed
Common options
If you use ossutil to switch to a bucket that is located in another region, add the -e option to the command to specify the endpoint of the region in which the specified bucket is located. If you use ossutil to switch to a bucket that belongs to another Alibaba Cloud account, add the -i option to the command to specify the AccessKey ID of the specified account, and add the -k option to the command to specify the AccessKey secret of the specified account.
For example, you can run the following command to query the parts of the testobject.txt object for which the multipart upload task is not incomplete. The testobject.txt object is in the testbucket bucket that is located in the China (Hangzhou) region and owned by another Alibaba Cloud account.
ossutil listpart oss://testbucket/testobject.txt 46C56B10E94A4ED6G8U9869F9409**** -e oss-cn-hangzhou.aliyuncs.com -i LTAI4Fw2NbDUCV8zYUzA**** -k 67DLVBkH7EamOjy2W5RVAHUY9H****
For more information about common options, see Common options.