Closed
Description
See the concepts doc and the registering object changes doc.
Pull requests target the 3956-storage-notifications
branch
Steps:
- Add a
BucketNotification
class, mapping the notification resource. Note that aBucketNotification
may point to a topic which belongs to a differentproject
than the one which owns its bucket. (Add 'BucketNotification' class. #3957) - Add
Bucket.notification
factory. returning newBucketNotification
. (Add 'Bucket.notification' factory #3958) - Add
BucketNotification.create
method, 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) - Add
BucketNotification.delete
method, mapping notifications/delete. Presumably barf if the ID is not set. (Add 'BucketNotification.delete' API wrapper. #3983) - Add
BucketNotification.exists
method, mapping notifications/get onto boolean (False forNotFound
). Presumably barf if the ID is not set. (Add 'BucketNotification.exists' API wrapper. #3984) - Add
BucketNotification.reload
method, mapping notifications/get, Presumably barf if the ID is not set. (Add 'BucketNotification.reload' API wrapper. #3986) - Add
Bucket.list_notifications
method, mapping notifications/list. Return an iterator ofBucketNotification
instances. (Add 'Bucket.list_notifications' API wrapper. #3990) - Add a system test which exercises the new API wrapper methods. (Add system tests for bucket notifications. #4021)
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 duringnotifications/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 thatThe docs say that a topic is created if it does not exist.BucketNotification.create
must verify the existence of its topic, and maybe create a new one. Or does the back-end do that? - 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.