All Products
Search
Document Center

Object Storage Service:getallpartsize

Last Updated:Aug 13, 2024

This topic describes how to run the getallpartsize command to obtain the size of each part generated and the total size of all parts in incomplete multipart upload tasks.

Usage notes

  • To query part information, you must have the oss:ListParts and oss:ListMultipartUploads permissions. For more information, see Attach a custom policy to a RAM user.

  • For ossutil V1.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 system. For ossutil earlier than V1.6.16, you must specify a binary name that corresponds to the system. For more information, see ossutil command reference.

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

Command syntax

ossutil getallpartsize oss://bucketname

The bucketname value specifies the name of the bucket that contains parts in incomplete multipart upload tasks.

Examples

The following sample command lists all parts that are generated in incomplete multipart upload tasks in the examplebucket bucket:

ossutil getallpartsize oss://examplebucket

The following sample output returns part information such as the part number, total part size, and upload ID.

PartNumber      UploadId                                Size(Byte)      Path
1               F18A92392DFD4B3FA897C267829FE417        52428800        oss://examplebucket/exampleobject.txt
2               F18A92392DFD4B3FA897C267829FE417        52428800        oss://examplebucket/exampleobject.txt
3               F18A92392DFD4B3FA897C267829FE417        52428800        oss://examplebucket/exampleobject.txt
4               F18A92392DFD4B3FA897C267829FE417        52428800        oss://examplebucket/exampleobject.txt
5               F18A92392DFD4B3FA897C267829FE417        52428800        oss://examplebucket/exampleobject.txt
6               F18A92392DFD4B3FA897C267829FE417        52428800        oss://examplebucket/exampleobject.txt

total part count:6     total part size(MB):300.00
0.142115(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, if you want to query parts generated in incomplete multipart upload tasks in the testbucket bucket owned by another Alibaba Cloud account in the China (Hangzhou) region, run the following command:

ossutil getallpartsize oss://testbucket -e oss-cn-hangzhou.aliyuncs.com -i LTAI4Fw2NbDUCV8zYUzA****  -k 67DLVBkH7EamOjy2W5RVAHUY9H****

For more information about common options, see Common options.