

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

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-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}}
```
Resultado:  

```
{
    "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](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/get-bucket-inventory-configuration.html) 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](https://docs.aws.amazon.com/powershell/v4/reference) 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](https://docs.aws.amazon.com/powershell/v5/reference) 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](sdk-general-information-section.md). Este tópico também inclui informações sobre como começar e detalhes sobre versões anteriores do SDK.