Uso de ListBucketInventoryConfigurations
con un AWS SDK o una CLI
En los siguientes ejemplos de código, se muestra cómo utilizar ListBucketInventoryConfigurations
.
- CLI
-
- AWS CLI
-
Recuperar una lista de las configuraciones de inventario de un bucket
En el siguiente ejemplo de list-bucket-inventory-configurations
, se enumeran las configuraciones de inventario del bucket especificado.
aws s3api list-bucket-inventory-configurations \
--bucket my-bucket
Salida:
{
"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
}
- PowerShell
-
- Herramientas para PowerShell
-
Ejemplo 1: este comando devuelve las primeras 100 configuraciones de inventario del bucket de S3 indicado.
Get-S3BucketInventoryConfigurationList -BucketName 's3testbucket'
Para obtener una lista completa de las guías para desarrolladores del AWS SDK y ejemplos de código, consulte Uso de este servicio con un SDK de AWS. En este tema también se incluye información sobre cómo comenzar a utilizar el SDK y detalles sobre sus versiones anteriores.