D'autres exemples de AWS SDK sont disponibles dans le référentiel AWS Doc SDK Examples
Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.
Utilisation de GetBucketNotification
avec une CLI
Les exemples de code suivants illustrent comment utiliser GetBucketNotification
.
- CLI
-
- AWS CLI
-
La commande suivante permet de récupérer la configuration des notifications pour un compartiment nommé
amzn-s3-demo-bucket
:aws s3api get-bucket-notification --bucket
amzn-s3-demo-bucket
Sortie :
{ "TopicConfiguration": { "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic", "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl", "Event": "s3:ObjectCreated:*", "Events": [ "s3:ObjectCreated:*" ] } }
-
Pour plus de détails sur l'API, reportez-vous GetBucketNotification
à la section Référence des AWS CLI commandes.
-
- PowerShell
-
- Outils pour PowerShell V4
-
Exemple 1 : Cet exemple récupère la configuration des notifications du bucket donné
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations
Sortie :
Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1
-
Pour plus de détails sur l'API, reportez-vous GetBucketNotificationà la section Référence des Outils AWS pour PowerShell applets de commande (V4).
-
- Outils pour PowerShell V5
-
Exemple 1 : Cet exemple récupère la configuration des notifications du bucket donné
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations
Sortie :
Id Topic -- ----- mimo arn:aws:sns:eu-west-1:123456789012:topic-1
-
Pour plus de détails sur l'API, reportez-vous GetBucketNotificationà la section Référence des Outils AWS pour PowerShell applets de commande (V5).
-