Usar GetBucketInventoryConfiguration com o AWS SDK ou a CLI - Amazon Simple Storage Service

Usar GetBucketInventoryConfiguration com o AWS SDK ou a CLI

Os exemplos de código a seguir mostram como usar o GetBucketInventoryConfiguration.

CLI
AWS CLI

Para recuperar a configuração de inventário de um bucket

O exemplo get-bucket-inventory-configuration a seguir recupera a configuração de inventário do bucket especificado com ID 1.

aws s3api get-bucket-inventory-configuration \ --bucket my-bucket \ --id 1

Saída:

{ "InventoryConfiguration": { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "ORC", "Bucket": "arn:aws:s3:::my-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "1", "Schedule": { "Frequency": "Weekly" } } }
PowerShell
Tools for PowerShell

Exemplo 1: este comando retorna os detalhes do inventário denominado “testinventory” para o bucket do S3 em questão.

Get-S3BucketInventoryConfiguration -BucketName 's3testbucket' -InventoryId 'testinventory'

Para obter uma lista completa dos Guias do desenvolvedor do SDK da AWS e exemplos de código, consulte Usar este serviço com um AWS SDK. Este tópico também inclui informações sobre como começar e detalhes sobre versões anteriores do SDK.