View a markdown version of this page

将 GetBucketInventoryConfiguration 与 CLI 配合使用 - Amazon Simple Storage Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

GetBucketInventoryConfiguration 与 CLI 配合使用

以下代码示例演示如何使用 GetBucketInventoryConfiguration

CLI
Amazon CLI

检索存储桶的清单配置

以下 get-bucket-inventory-configuration 示例检索 ID 为 1 的指定存储桶的清单配置。

aws s3api get-bucket-inventory-configuration \ --bucket amzn-s3-demo-bucket \ --id 1

输出:

{ "InventoryConfiguration": { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "ORC", "Bucket": "arn:aws:s3:::amzn-s3-demo-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "1", "Schedule": { "Frequency": "Weekly" } } }
PowerShell
适用于 PowerShell V4 的工具

示例 1:此命令返回给定 S3 存储桶的名为“testinventory”的清单的详细信息。

Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
适用于 PowerShell V5 的工具

示例 1:此命令返回给定 S3 存储桶的名为“testinventory”的清单的详细信息。

Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'

有关 Amazon SDK 开发人员指南和代码示例的完整列表,请参阅 使用 Amazon SDK 通过 Amazon S3 进行开发。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。