See the concepts doc and the registering object changes doc.
Pull requests target the 3956-storage-notifications branch
Steps:
Questions:
- Do we need to support de novo creation of
BucketNotfication instances w/ a user-supplied ID? The spec says that the ID is generated during notifications/insert, which suggests not.
- I assume that access to the new features does not depend on being able to import
google.cloud.pubsub. The counter-example would be that BucketNotification.create must verify the existence of its topic, and maybe create a new one. Or does the back-end do that? The docs say that a topic is created if it does not exist.
- There is no documented support for update / patch of existing notifications. Is that intentional?
- What are the intended semantics of passing {'payload_format`: 'NONE'}? I don't think subscribers will find message with an empty payload useful, so I must be misunderstanding something. Do the non-payload attributes provide enough information for the subscriber to do something useful?
/cc @lukesneeringer, perhaps to loop in the appropriate GCS back-end contact.
See the concepts doc and the registering object changes doc.
Pull requests target the
3956-storage-notificationsbranchSteps:
BucketNotificationclass, mapping the notification resource. Note that aBucketNotificationmay point to a topic which belongs to a differentprojectthan the one which owns its bucket. (Add 'BucketNotification' class. #3957)Bucket.notificationfactory. returning newBucketNotification. (Add 'Bucket.notification' factory #3958)BucketNotification.createmethod, mapping notifications/insert. Update the bucket's properties from the response (e.g., to get its server-generated ID). Should we barf if the ID is already set? (Add 'BucketNotification.create' API wrapper. #3966)BucketNotification.deletemethod, mapping notifications/delete. Presumably barf if the ID is not set. (Add 'BucketNotification.delete' API wrapper. #3983)BucketNotification.existsmethod, mapping notifications/get onto boolean (False forNotFound). Presumably barf if the ID is not set. (Add 'BucketNotification.exists' API wrapper. #3984)BucketNotification.reloadmethod, mapping notifications/get, Presumably barf if the ID is not set. (Add 'BucketNotification.reload' API wrapper. #3986)Bucket.list_notificationsmethod, mapping notifications/list. Return an iterator ofBucketNotificationinstances. (Add 'Bucket.list_notifications' API wrapper. #3990)Questions:
BucketNotficationinstances w/ a user-supplied ID? The spec says that the ID is generated duringnotifications/insert, which suggests not.google.cloud.pubsub.The counter-example would be thatThe docs say that a topic is created if it does not exist.BucketNotification.createmust verify the existence of its topic, and maybe create a new one. Or does the back-end do that?/cc @lukesneeringer, perhaps to loop in the appropriate GCS back-end contact.