Utilizar GetBucketInventoryConfiguration con una CLI - Ejemplos de código de AWS SDK

Hay más ejemplos de AWS SDK disponibles en el repositorio de GitHub de ejemplos de AWS SDK de documentos.

Utilizar GetBucketInventoryConfiguration con una CLI

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" } } }
PowerShell
Herramientas para PowerShell V4

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 información sobre la API, consulte GetBucketInventoryConfiguration en la Referencia de cmdlets de Herramientas de AWS para PowerShell (V4).

Herramientas para PowerShell V5

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 información sobre la API, consulte GetBucketInventoryConfiguration en la Referencia de cmdlets de Herramientas de AWS para PowerShell (V5).