全部產品
Search
文件中心

Object Storage Service:list-parts

更新時間:Apr 03, 2025

list-parts用於列舉指定Upload ID所屬的所有已經上傳成功的Part。

注意事項

  • OSS的返回結果按照Part號碼升序排列。

  • 由於網路傳輸可能出錯,所以不推薦使用list-parts來返回結果中的Part Number和ETag值來產生已經上傳成功的Part列表。

許可權說明

阿里雲帳號預設擁有全部許可權。阿里雲帳號下的RAM使用者或RAM角色預設沒有任何許可權,需要阿里雲帳號或帳號管理員通過RAM PolicyBucket Policy授予操作許可權。

API

Action

說明

ListParts

oss:ListParts

列舉指定Upload ID所屬的所有已經上傳成功的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中前 100 個Part。

    ossutil api list-parts --bucket examplebucket --key exampleobject --upload-id 123 --max-parts 100
  • 列舉目標儲存空間examplebucket中所有Part,並對對象名字進行URL編碼。

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