

Hay más ejemplos de AWS SDK disponibles en el GitHub repositorio de [ejemplos de AWS Doc SDK](https://github.com/awsdocs/aws-doc-sdk-examples).

Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.

# Utilizar `GetBucketInventoryConfiguration` con una CLI
<a name="s3_example_s3_GetBucketInventoryConfiguration_section"></a>

Los siguientes ejemplos de código muestran cómo utilizar `GetBucketInventoryConfiguration`.

------
#### [ CLI ]

**AWS CLI**  
**Recuperar la configuración de inventario de un bucket**  
En el siguiente ejemplo de `get-bucket-inventory-configuration`, se recupera la configuración de inventario del bucket especificado con el ID `1`.  

```
aws s3api get-bucket-inventory-configuration \
    --bucket amzn-s3-demo-bucket \
    --id 1
```
Salida:  

```
{
    "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 obtener más información sobre la API, consulte [GetBucketInventoryConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/get-bucket-inventory-configuration.html)la *Referencia de AWS CLI comandos*. 

------
#### [ PowerShell ]

**Herramientas para la PowerShell versión 4**  
**Ejemplo 1: este comando devuelve los detalles del inventario con el nombre “testinventory” del bucket de S3 indicado.**  

```
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
```
+  Para obtener más información sobre la API, consulte [GetBucketInventoryConfiguration Herramientas de AWS para PowerShell](https://docs.aws.amazon.com/powershell/v4/reference)*Cmdlet Reference (V4)*. 

**Herramientas para la versión 5 PowerShell **  
**Ejemplo 1: este comando devuelve los detalles del inventario con el nombre “testinventory” del bucket de S3 indicado.**  

```
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
```
+  Para obtener más información sobre la API, consulte [GetBucketInventoryConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)la *referencia de Herramientas de AWS para PowerShell cmdlets (*V5). 

------