All Products
Search
Document Center

Object Storage Service:listpart

Last Updated:Apr 03, 2024

This topic describes how to run the listpart command to list parts that are associated with an incomplete multipart upload.

Usage notes

  • To list parts, you must have the oss:ListParts permission. For more information, see Attach a custom policy to a RAM user.

  • This topic provides sample command lines that are based on the 64-bit Linux system. For other systems, replace ./ossutil64 in the commands with the corresponding binary name. For more information, see ossutil command reference.

  • For more information about multipart uploads, see Multipart upload.

Command syntax

./ossutil64 listpart oss://bucketname/objectname uploadid

The following table describes the parameters in the syntax.

Parameter

Description

bucketname

The name of the bucket.

objectname

The name of the object for which the multipart upload task is not completed.

uploadid

The upload ID that identifies the multipart upload task. The upload ID is returned when you initiate the multipart upload. You can use the upload ID to perform multipart upload operations, such as canceling the multipart upload and querying the multipart upload.

Important

You can use the -m option in the ls command to query part information, such as objects whose multipart uploads are incomplete, the time when a multipart upload was initiated, and the upload IDs. For more information, see ls.

Examples

You can run the following command to list parts that are associated with the incomplete multipart upload task for the exampleobject.txt object in the examplebucket bucket:

./ossutil64 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 information about parts associated with an incomplete multipart upload task for the testobject.txt object. The testobject.txt object is in the testbucket bucket that is located in the China (Hangzhou) region and owned by another Alibaba Cloud account.

./ossutil64 listpart oss://testbucket/testobject.txt 46C56B10E94A4ED6G8U9869F9409**** -e oss-cn-hangzhou.aliyuncs.com -i LTAI4Fw2NbDUCV8zYUzA****  -k 67DLVBkH7EamOjy2W5RVAHUY9H****

For more information about other common options that you can use for the sync command, see Common options.