ListBucketInventory は、バケットのすべてのインベントリ設定を一覧表示します。
使用上の注意
ListBucketInventory 操作を呼び出すには、oss:GetBucketInventory のアクセス許可が必要です。詳細については、「RAM ユーザーにカスタム権限ポリシーを付与する」をご参照ください。
1 回のリクエストで取得できるインベントリ設定は最大 100 件です。レスポンスが切り捨てられた場合は、レスポンスの NextContinuationToken 値を次のリクエストの continuation-token として使用し、結果の次のページを取得してください。
バケットのインベントリ設定を管理する権限があることを確認してください。デフォルトでは、バケット所有者のみがこの権限を持ちます。所有者でない場合は、必要な権限をリクエストしてください。
リクエスト構文
continuation-token を使用する場合
GET /?inventory&continuation-token=xxx HTTP/1.1continuation-token を使用しない場合
GET /?inventory HTTP/1.1
レスポンス要素
パラメータ | 型 | 説明 |
InventoryConfiguration | container | インベントリ設定のコンテナです。 |
IsTruncated | Boolean | インベントリ設定のリストが切り捨てられているかどうかを示します。 有効な値:true または false
|
NextContinuationToken | String | レスポンスが切り捨てられている場合 (IsTruncated が true)、このトークンを次のリクエストの continuation-token パラメータに使用して、結果の次のページを取得してください。 |
Id | String | ユーザーが指定したインベントリ設定の名前です。名前はバケット内で一意である必要があります。 |
IsEnabled | Boolean | インベントリが有効かどうかを指定します。 有効な値:true または false
|
Filter | container | フィルタルールのコンテナです。インベントリには、フィルタに一致するオブジェクトのみが含まれます。 |
Prefix | String | フィルタリングに使用するオブジェクトプレフィックスです。 親ノード:Filter |
Destination | container | インベントリ結果の出力先に関する情報のコンテナです。 |
OSSBucketDestination | container | インベントリレポートが保存される送信先バケットの詳細が含まれます。 親ノード:Destination |
Format | String | エクスポートされるインベントリのファイル形式です。 有効な値:CSV、Parquet (Parquet 形式は現在、英国 (ロンドン) リージョンでのみサポートされています。) 親ノード:OSSBucketDestination |
AccountId | String | 送信先バケットにインベントリレポートを書き込む権限を付与されたアカウントの ID です。 親ノード:OSSBucketDestination |
RoleArn | String | 送信先バケットにインベントリレポートを書き込む権限を付与されたロールの ARN です。 形式:acs:ram::uid:role/rolename 親ノード:OSSBucketDestination |
Bucket | String | インベントリレポートの送信先バケットです。 親ノード:OSSBucketDestination |
Prefix | String | インベントリレポートが保存される送信先バケット内のプレフィックスです。 親ノード:OSSBucketDestination |
Encryption | container | インベントリレポートのサーバー側の暗号化方式です。 有効な値:SSE-OSS、SSE-KMS、または Null 親ノード:OSSBucketDestination |
SSE-OSS | container | SSE-OSS 暗号化のコンテナです。 親ノード:Encryption |
SSE-KMS | container | SSE-KMS 暗号化に使用するキーのコンテナです。 親ノード:Encryption |
KeyId | String | KMS キー ID です。 親ノード:SSE-KMS |
Schedule | container | インベントリのエクスポートスケジュールのコンテナです。 |
Frequency | String | インベントリのエクスポート頻度です。 有効な値: 親ノード:Schedule |
DayOfMonth | Integer |
親ノード:Schedule |
AutoDelete | Boolean | 1 回限りのインベントリをエクスポートした後、インベントリ設定を自動的に削除するかどうかを指定します。この要素は、 有効な値:true、false 親ノード:Schedule |
IncludedObjectVersions | String | インベントリに含めるオブジェクトバージョンを指定します。 有効な値:
|
OptionalFields | container | インベントリに含めるオプションフィールドのコンテナです。 |
Field | String | インベントリに含めるオプションフィールドです。 オプションフィールドには、 親ノード:OptionalFields |
IncrementalInventory | container | 増分インベントリ設定のコンテナです。 |
IsEnabled | Boolean | 増分インベントリを有効にするかどうかを示します。 有効な値:
true の場合、親の IsEnabled が false であっても、増分インベントリは有効になります。 親ノード:IncrementalInventory |
Schedule | container | 増分インベントリのエクスポートスケジュールのコンテナです。 親ノード:IncrementalInventory |
Frequency | Integer | 増分インベントリのエクスポート頻度 (秒単位) です。 システムは 600 秒の固定間隔で増分インベントリをエクスポートします。各間隔で、システムは自動的にディレクトリプレフィックスを作成し、マニフェストファイルと複数の CSV ファイルを生成します。カスタム頻度はサポートされていません。 親ノード:Schedule |
OptionalFields | container | 増分インベントリに含めるオプションフィールドのコンテナです。 親ノード:IncrementalInventory |
Field | String | 増分インベントリに含まれるフィールドです。 親ノード:OptionalFields
|
例
リクエストのサンプル
GET /?inventory HTTP/1.1 Host: BucketName.oss.aliyuncs.com Date: Fri, 24 Feb 2012 03:55:00 GMT Authorization: authorization string Content-Type: text/plainレスポンスのサンプル
HTTP/1.1 200 OK x-oss-request-id: 56594298207FB304438516F9 Date: Sat, 30 Apr 2016 23:29:37 GMT Content-Type: application/xml Content-Length: length Connection: close Server: AliyunOSS <?xml version="1.0" encoding="UTF-8"?> <ListInventoryConfigurationsResult> <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:::destination-bucket</Bucket> <Prefix>prefix1</Prefix> </OSSBucketDestination> </Destination> <Schedule> <Frequency>Daily</Frequency> </Schedule> <Filter> <Prefix>prefix/One</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> <InventoryConfiguration> <Id>report2</Id> <IsEnabled>true</IsEnabled> <Destination> <OSSBucketDestination> <Format>CSV</Format> <AccountId>1000000000000000</AccountId> <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn> <Bucket>acs:oss:::destination-bucket</Bucket> <Prefix>prefix2</Prefix> </OSSBucketDestination> </Destination> <Schedule> <Frequency>Daily</Frequency> </Schedule> <Filter> <Prefix>prefix/Two</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> <InventoryConfiguration> <Id>report3</Id> <IsEnabled>true</IsEnabled> <Destination> <OSSBucketDestination> <Format>CSV</Format> <AccountId>1000000000000000</AccountId> <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn> <Bucket>acs:oss:::destination-bucket</Bucket> <Prefix>prefix3</Prefix> </OSSBucketDestination> </Destination> <Schedule> <Frequency>Daily</Frequency> </Schedule> <Filter> <Prefix>prefix/Three</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> ... <IsTruncated>true</IsTruncated> <NextContinuationToken>...</NextContinuationToken> </ListInventoryConfigurationsResult>
SDK
以下の SDK を使用してこの操作を呼び出すことができます。
ossutil CLI
ossutil を使用してこの操作を実行するには、list-bucket-inventory コマンドをご参照ください。