Usar o ListBucketInventoryConfigurations
com um 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 }
-
Para obter detalhes da API, consulte ListBucketInventoryConfigurations
na Referência de comandos da AWS CLI.
-
- PowerShell
-
- Ferramentas para 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 detalhes da API, consulte ListBucketInventoryConfigurations na AWS Tools for PowerShell Cmdlet Reference.
-
Para ver uma lista completa dos Guias do desenvolvedor de 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.