The following steps add a notification configuration to your bucket that sends notifications for all supported events.
To send notifications for a subset of events, include the -e flag with your gsutil command or the event_types key in the body of your JSON request.
Here's how you can do it using gsutil:
Use the gsutil notification create command, replacing [VALUES_IN_BRACKETS] with the appropriate values:
gsutil notification create -t [TOPIC_NAME] -f json gs://[BUCKET_NAME]
If you use a [TOPIC_NAME] that doesn't exist in your project, gsutil creates one for you.