Usar GetBucketInventoryConfiguration com uma CLI
Os exemplos de código a seguir mostram como usar GetBucketInventoryConfiguration.
- CLI
-
- AWS CLI
-
Para recuperar a configuração de inventário de um bucket
O exemplo
get-bucket-inventory-configurationa seguir recupera a configuração de inventário do bucket especificado com ID1.aws s3api get-bucket-inventory-configuration \ --bucketamzn-s3-demo-bucket\ --id1Resultado:
{ "InventoryConfiguration": { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "ORC", "Bucket": "arn:aws:s3:::amzn-s3-demo-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "1", "Schedule": { "Frequency": "Weekly" } } }-
Consulte detalhes da API em GetBucketInventoryConfiguration
na Referência de comandos da AWS CLI.
-
- PowerShell
-
- Ferramentas para PowerShell V4
-
Exemplo 1: este comando retorna os detalhes do inventário denominado “testinventory” para o bucket do S3 em questão.
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'-
Consulte detalhes da API em GetBucketInventoryConfiguration na Referência de cmdlet do Ferramentas da AWS para PowerShell (V4).
-
- Ferramentas para PowerShell V5
-
Exemplo 1: este comando retorna os detalhes do inventário denominado “testinventory” para o bucket do S3 em questão.
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'-
Consulte detalhes da API em GetBucketInventoryConfiguration na Referência de cmdlet do Ferramentas da AWS para PowerShell (V5).
-
Para ver uma lista completa dos guias de desenvolvedor e exemplos de código do SDK da AWS, consulte Desenvolvimento com o Amazon S3 usando AWS SDKs. Este tópico também inclui informações sobre como começar e detalhes sobre versões anteriores do SDK.