全部產品
Search
文件中心

Object Storage Service:get-object-tagging

更新時間:Sep 21, 2024

get-object-tagging用於擷取對象(Object)的標籤(Tagging)資訊。

注意事項

  • 阿里雲帳號預設擁有擷取對象的標籤的許可權。如果您需要通過RAM使用者或者STS的方式擷取,您必須擁有oss:GetObjectTagging許可權。具體操作,請參見為RAM使用者授權自訂的權限原則

  • 使用get-object-tagging命令時,預設只能擷取Object目前的版本的標籤資訊。您可以通過指定versionId參數來擷取指定Object版本的標籤資訊。

命令格式

ossutil api get-object-tagging --bucket value --key value [flags]

參數

類型

說明

--bucket

string

Bucket名稱。

--key

string

Object的完整路徑。

--version-id

string

Object的版本號碼。

說明

使用樣本

  • 擷取儲存空間examplebucket的標籤資訊。

    ossutil api get-object-tagging --bucket examplebucket --key exampleobject
  • 擷取儲存空間examplebucket的標籤資訊,以JSON格式顯示。

    ossutil api get-object-tagging --bucket examplebucket --key exampleobject --output-format json
  • 擷取儲存空間examplebucket的標籤資訊,以YAML格式顯示。

    ossutil api get-object-tagging --bucket examplebucket --key exampleobject --output-format yaml