Uso de GetBucketInventoryConfiguration
con un AWS SDK o una CLI
En los siguientes ejemplos de código, se muestra 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 my-bucket
\
--id 1
Salida:
{
"InventoryConfiguration": {
"IsEnabled": true,
"Destination": {
"S3BucketDestination": {
"Format": "ORC",
"Bucket": "arn:aws:s3:::my-bucket",
"AccountId": "123456789012"
}
},
"IncludedObjectVersions": "Current",
"Id": "1",
"Schedule": {
"Frequency": "Weekly"
}
}
}
- PowerShell
-
- Herramientas para PowerShell
-
Ejemplo 1: este comando devuelve los detalles del inventario con el nombre “testinventory” del bucket de S3 indicado.
Get-S3BucketInventoryConfiguration -BucketName 's3testbucket' -InventoryId 'testinventory'
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.