文档

list-parts

更新时间:

list-parts用于列举指定Upload ID所属的所有已经上传成功的Part。

注意事项

  • 阿里云账号默认拥有列举指定Upload ID所属的所有已经上传成功Part的权限。如果您需要通过RAM用户或者STS的方式进行列举,您必须拥有oss:ListParts权限。具体操作,请参见为RAM用户授权自定义的权限策略

  • OSS的返回结果按照Part号码升序排列。

  • 由于网络传输可能出错,所以不推荐使用list-parts来返回结果中的Part Number和ETag值来生成已经上传成功的Part列表。

命令格式

ossutil api list-parts --bucket value --key value --upload-id value [flags]

参数

类型

说明

--bucket

string

Bucket名称。

--key

string

Object的完整路径。

--encoding-type

string

指定对返回的内容进行编码,指定编码的类型。

--max-parts

int

规定在OSS响应中的最大Part数目。

--part-number-marker

int

指定List的起始位置,只有Part Number数目大于该参数的Part会被列出。

--upload-id

string

MultipartUpload事件的ID。

说明

使用示例

  • 列举目标存储空间examplebucket名字为exampleobject且Upload ID是123的所有已经上传成功Part。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123
  • 列举目标存储空间examplebucket名字为exampleobject且Upload ID是123的所有已经上传成功Part,以JSON格式显示。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --output-format json
  • 列举目标存储空间examplebucket名字为exampleobject且Upload ID是123的所有已经上传成功Part,以YAML格式显示。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --output-format yaml
  • 列举目标存储空间examplebucket中指定前缀下dir下的Part。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --prefix dir
  • 列举目标存储空间examplebucket中前 100 个Part。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --max-parts 100
  • 列举目标存储空间examplebucket中根目录下Part。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --delimiter /
  • 列举目标存储空间examplebucket中从test.txt之后按字母排序返回Part。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --key-marker test.txt
  • 列举目标存储空间examplebucket中所有Part,并对对象名字进行URL编码。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --encoding-type url