文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
将 GetBucketInventoryConfiguration
与 CLI 配合使用
以下代码示例演示如何使用 GetBucketInventoryConfiguration
。
- CLI
-
- AWS CLI
-
检索存储桶的清单配置
以下
get-bucket-inventory-configuration
示例检索 ID 为1
的指定存储桶的清单配置。aws s3api get-bucket-inventory-configuration \ --bucket
amzn-s3-demo-bucket
\ --id1
输出:
{ "InventoryConfiguration": { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "ORC", "Bucket": "arn:aws:s3:::amzn-s3-demo-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "1", "Schedule": { "Frequency": "Weekly" } } }
-
有关 API 的详细信息,请参阅AWS CLI 命令参考GetBucketInventoryConfiguration
中的。
-
- PowerShell
-
- 用于 PowerShell
-
示例 1:此命令返回给定 S3 存储桶的名为“testinventory”的清单的详细信息。
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
-
有关 API 的详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考GetBucketInventoryConfiguration中的。
-
GetBucketEncryption
GetBucketLifecycleConfiguration