1
votes

How can I view currently configured Object Change Notifications (OCNs) for a given GCS Bucket?

I thought it would be as follows: gsutil notification list gs://my-bucket-name

But then I was surprised by this in gsutil help notification:

LIST The list sub-command provides a list of notification configs belonging to a given bucket. The listed name of each notification config can be used with the delete sub-command to delete that specific notification config.

No object change notifications will be listed. Only Cloud Pub/Sub notification subscription configs will be listed.

Notice the last paragraph.

1

1 Answers

0
votes

You should add -o like following example:

gsutil notification list -o gs://${BucketName}

And this will list Object Change Notifications:

Bucket ${BucketName} has the following active Object Change Notifications:
Notification channel 1:
    Channel identifier: xxxxxxxx
    Resource identifier: xxxxxx
    Application URL: url=https://xxxxxx.appspot.com/notify
    Created by:
    Creation time: xxxx

Reference: notification command