

Há mais exemplos de AWS SDK disponíveis no repositório [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub .

As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.

# Usar `GetBucketInventoryConfiguration` com uma CLI
<a name="s3_example_s3_GetBucketInventoryConfiguration_section"></a>

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 amzn-s3-demo-bucket \
    --id 1
```
Saída:  

```
{
    "InventoryConfiguration": {
        "IsEnabled": true,
        "Destination": {
            "S3BucketDestination": {
                "Format": "ORC",
                "Bucket": "arn:aws:s3:::amzn-s3-demo-bucket",
                "AccountId": "123456789012"
            }
        },
        "IncludedObjectVersions": "Current",
        "Id": "1",
        "Schedule": {
            "Frequency": "Weekly"
        }
    }
}
```
+  Para obter detalhes da API, consulte [GetBucketInventoryConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/get-bucket-inventory-configuration.html)em *Referência de AWS CLI Comandos*. 

------
#### [ 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'
```
+  Para obter detalhes da API, consulte [GetBucketInventoryConfiguration](https://docs.aws.amazon.com/powershell/v4/reference)em *Referência de Ferramentas da AWS para PowerShell cmdlet (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'
```
+  Para obter detalhes da API, consulte [GetBucketInventoryConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)em *Referência de Ferramentas da AWS para PowerShell cmdlet (V5)*. 

------