GetBucketInventory
GetBucketInventory用於查看某個儲存空間(Bucket)中指定的清單(Inventory)任務。
注意事項
阿里雲帳號預設擁有查看Bucket指定清單任務的許可權。如果您需要通過RAM使用者或者STS的方式進行查看,您必須擁有oss:GetBucketInventory許可權。
請求文法
GET /?inventory&inventoryId=inventoryId HTTP/1.1
請求元素
|
名稱 |
類型 |
是否必選 |
描述 |
|
inventoryId |
字串 |
是 |
查詢的清單規則Id。 |
響應元素
|
名稱 |
類型 |
描述 |
|
Id |
字串 |
由使用者指定的清單名稱,清單名稱在當前儲存空間下必須全域唯一。 |
|
IsEnabled |
布爾 |
清單是否啟用的標識。 有效值:true或false
|
|
Filter |
容器 |
清單篩選的首碼。指定首碼後,清單將篩選出符合首碼設定的對象。 |
|
Prefix |
字串 |
篩選規則的匹配首碼。 父節點:Filter |
|
Destination |
容器 |
存放清單結果的資訊。 |
|
OSSBucketDestination |
容器 |
清單結果匯出後存放的儲存空間資訊。 父節點:Destination |
|
Format |
字串 |
匯出資訊清單檔的檔案格式。 有效值:CSV 父節點:OSSBucketDestination |
|
AccountId |
字串 |
儲存空間所有者授予的賬戶ID。 父節點:OSSBucketDestination |
|
RoleArn |
字串 |
儲存空間所有者授予操作許可權的角色名稱。 格式為:acs:ram::uid:role/rolename 父節點:OSSBucketDestination |
|
Bucket |
字串 |
存放匯出的資訊清單檔的儲存空間。 父節點:OSSBucketDestination |
|
Prefix |
字串 |
資訊清單檔的儲存路徑首碼。 父節點:OSSBucketDestination |
|
Encryption |
容器 |
資訊清單檔的加密方式。 有效值:SSE-OSS、SSE-KMS或空 父節點:OSSBucketDestination |
|
SSE-OSS |
容器 |
SSE-OSS加密方式的容器。 父節點:Encryption |
|
SSE-KMS |
容器 |
用於儲存SSE-KMS加密方式下的密鑰的容器。 父節點:Encryption |
|
KeyId |
字串 |
KMS密鑰id。 父節點:SSE-KMS |
|
Schedule |
容器 |
存放清單匯出周期資訊的容器。 |
|
Frequency |
字串 |
資訊清單檔匯出的周期。 有效值:Daily、Weekly、Monthly或Once 父節點:Schedule |
|
DayOfMonth |
正整數 |
Frequency為Monthly時,每月第幾天匯出清單。取值範圍為1~31的正整數。 父節點:Schedule |
|
AutoDelete |
布爾 |
once清單執行後,是否自動刪除once清單配置。僅在Frequency為Once時,才允許存在該欄位。 有效值:true、false 父節點:Schedule |
|
IncludedObjectVersions |
字串 |
是否在清單中包含Object版本資訊。 有效值:All或Current
|
|
OptionalFields |
容器 |
設定清單結果中應包含的配置項。 |
|
Field |
字串 |
清單結果中包含的配置項。 可選的配置項:Size、LastModifiedDate、TransitionTime、ETag、StorageClass、IsMultipartUploaded、EncryptionStatus、ObjectAcl、TaggingCount、ObjectType、Crc64 父節點:OptionalFields |
|
IncrementalInventory |
容器 |
增量清單的配置資訊。 |
|
IsEnabled |
布爾 |
是否開啟增量清單。 有效值:
當取值為true 時,增量清單功能啟用,不受上層enable=false 的影響。 父節點:IncrementalInventory |
|
Schedule |
容器 |
增量清單的匯出周期。 父節點:IncrementalInventory |
|
Frequency |
正整數 |
增量清單的匯出頻率,單位為秒。 系統當前以 600 秒為固定周期,每個周期自動建立一個目錄首碼,並產生對應的 manifest 檔案及該周期內產生的多份 CSV 檔案。暫不支援自訂頻率設定。 父節點:Schedule |
|
OptionalFields |
容器 |
設定增量清單中包含的配置項。 父節點:IncrementalInventory |
|
Field |
字串 |
增量清單中包含的配置項。 父節點:OptionalFields
|
樣本
-
請求樣本
GET /?inventory&inventoryId=list1 HTTP/1.1 -
返回樣本
HTTP/1.1 200 OK x-oss-request-id: 56594298207FB304438516F9 Date: Mon, 31 Oct 2016 12:00:00 GMT Server: AliyunOSS Content-Length: length <?xml version="1.0" encoding="UTF-8"?> <InventoryConfiguration> <Id>report1</Id> <IsEnabled>true</IsEnabled> <Destination> <OSSBucketDestination> <Format>CSV</Format> <AccountId>1000000000000000</AccountId> <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn> <Bucket>acs:oss:::bucket_0001</Bucket> <Prefix>prefix1</Prefix> <Encryption> <SSE-OSS/> </Encryption> </OSSBucketDestination> </Destination> <Schedule> <Frequency>Daily</Frequency> </Schedule> <Filter> <Prefix>myprefix/</Prefix> </Filter> <IncludedObjectVersions>All</IncludedObjectVersions> <OptionalFields> <Field>Size</Field> <Field>LastModifiedDate</Field> <Field>ETag</Field> <Field>StorageClass</Field> <Field>IsMultipartUploaded</Field> <Field>EncryptionStatus</Field> </OptionalFields> </InventoryConfiguration>
SDK
此介面所對應的各語言SDK如下:
命令列工具ossutil
GetBucketInventory介面所對應的ossutil命令,請參見get-bucket-inventory。