Utilizar GetBucketNotification con una CLI
Los siguientes ejemplos de código muestran cómo utilizar GetBucketNotification.
- CLI
-
- AWS CLI
-
El siguiente comando recupera la configuración de notificaciones de un bucket denominado
amzn-s3-demo-bucket:aws s3api get-bucket-notification --bucketamzn-s3-demo-bucketSalida:
{ "TopicConfiguration": { "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic", "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl", "Event": "s3:ObjectCreated:*", "Events": [ "s3:ObjectCreated:*" ] } }-
Para obtener información sobre la API, consulte GetBucketNotification
en la Referencia de comandos de la AWS CLI.
-
- PowerShell
-
- Herramientas para PowerShell V4
-
Ejemplo 1: en este ejemplo se recupera la configuración de notificaciones del bucket en cuestión
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurationsSalida:
Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1-
Para obtener información sobre la API, consulte GetBucketNotification en la Referencia de cmdlets de Herramientas de AWS para PowerShell (V4).
-
- Herramientas para PowerShell V5
-
Ejemplo 1: en este ejemplo se recupera la configuración de notificaciones del bucket en cuestión
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurationsSalida:
Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1-
Para obtener información sobre la API, consulte GetBucketNotification en la Referencia de cmdlets de Herramientas de AWS para PowerShell (V5).
-
Para obtener una lista completa de las guías para desarrolladores de AWS SDK y ejemplos de código, consulte Desarrollo con Amazon S3 mediante los SDK de AWS. En este tema también se incluye información sobre cómo empezar a utilizar el SDK y detalles sobre sus versiones anteriores.