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

Usar ListBucketInventoryConfigurations com o AWS SDK ou a CLI

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

CLI
AWS CLI

Como recuperar uma lista de configurações de inventário de um bucket

O exemplo list-bucket-inventory-configurations a seguir recupera as configurações de inventário do bucket especificado.

aws s3api list-bucket-inventory-configurations \ --bucket my-bucket

Saída:

{ "InventoryConfigurationList": [ { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "ORC", "Bucket": "arn:aws:s3:::my-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "1", "Schedule": { "Frequency": "Weekly" } }, { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "CSV", "Bucket": "arn:aws:s3:::my-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "2", "Schedule": { "Frequency": "Daily" } } ], "IsTruncated": false }
PowerShell
Tools for PowerShell

Exemplo 1: este comando retorna as cem primeiras configurações de inventário do bucket do S3 em questão.

Get-S3BucketInventoryConfigurationList -BucketName 's3testbucket'

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.