Skip to main content

notifications

Creates, updates, deletes, gets or lists a notifications resource.

Overview

Namenotifications
TypeResource
Idgoogle.storage.notifications

Fields

NameDatatypeDescription
idstringThe ID of the notification.
custom_attributesobjectAn optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.
etagstringHTTP 1.1 Entity tag for this subscription notification.
event_typesarrayIf present, only send notifications about listed event types. If empty, sent notifications for all event types.
kindstringThe kind of item this is. For notifications, this is always storage#notification.
object_name_prefixstringIf present, only apply this notification configuration to object names that begin with this prefix.
payload_formatstringThe desired content of the Payload.
selfLinkstringThe canonical URL of this notification.
topicstringThe Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'

Methods

NameAccessible byRequired ParamsDescription
getSELECTbucket, notificationView a notification configuration.
listSELECTbucketRetrieves a list of notification subscriptions for a given bucket.
insertINSERTbucketCreates a notification subscription for a given bucket.
deleteDELETEbucket, notificationPermanently deletes a notification subscription.

SELECT examples

Retrieves a list of notification subscriptions for a given bucket.

SELECT
id,
custom_attributes,
etag,
event_types,
kind,
object_name_prefix,
payload_format,
selfLink,
topic
FROM google.storage.notifications
WHERE bucket = '{{ bucket }}';

INSERT example

Use the following StackQL query and manifest file to create a new notifications resource.

/*+ create */
INSERT INTO google.storage.notifications (
bucket,
custom_attributes,
etag,
event_types,
object_name_prefix,
payload_format,
topic
)
SELECT
'{{ bucket }}',
'{{ custom_attributes }}',
'{{ etag }}',
'{{ event_types }}',
'{{ object_name_prefix }}',
'{{ payload_format }}',
'{{ topic }}'
;

DELETE example

Deletes the specified notifications resource.

/*+ delete */
DELETE FROM google.storage.notifications
WHERE bucket = '{{ bucket }}'
AND notification = '{{ notification }}';