AWS 文档 SDK 示例
将 GetBucketInventoryConfiguration 与 CLI 配合使用
以下代码示例演示如何使用 GetBucketInventoryConfiguration。
- CLI
-
- AWS CLI
-
检索存储桶的清单配置
以下
get-bucket-inventory-configuration示例检索 ID 为1的指定存储桶的清单配置。aws s3api get-bucket-inventory-configuration \ --bucketamzn-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
-
- Tools for PowerShell V4
-
示例 1:此命令返回给定 S3 存储桶的名为“testinventory”的清单的详细信息。
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 GetBucketInventoryConfiguration。
-
- Tools for PowerShell V5
-
示例 1:此命令返回给定 S3 存储桶的名为“testinventory”的清单的详细信息。
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 GetBucketInventoryConfiguration。
-
GetBucketEncryption
GetBucketLifecycleConfiguration