notifications
Creates, updates, deletes, gets or lists a notifications
resource.
Overview
Name | notifications |
Type | Resource |
Id | google.storage.notifications |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID of the notification. |
custom_attributes | object | An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription. |
etag | string | HTTP 1.1 Entity tag for this subscription notification. |
event_types | array | If present, only send notifications about listed event types. If empty, sent notifications for all event types. |
kind | string | The kind of item this is. For notifications, this is always storage#notification. (default: storage#notification) |
object_name_prefix | string | If present, only apply this notification configuration to object names that begin with this prefix. |
payload_format | string | The desired content of the Payload. (default: JSON_API_V1) |
selfLink | string | The canonical URL of this notification. |
topic | string | The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}' |
Successful response
Name | Datatype | Description |
---|---|---|
items | array | The list of items. |
kind | string | The kind of item this is. For lists of notifications, this is always storage#notifications. (default: storage#notifications) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | bucket , notification | userProject | View a notification configuration. |
list | select | bucket | userProject | Retrieves a list of notification subscriptions for a given bucket. |
insert | insert | bucket | userProject | Creates a notification subscription for a given bucket. |
delete | delete | bucket , notification | userProject | Permanently deletes a notification subscription. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
bucket | string | |
notification | string | |
userProject | string |
SELECT
examples
- get
- list
View a notification configuration.
SELECT
id,
custom_attributes,
etag,
event_types,
kind,
object_name_prefix,
payload_format,
selfLink,
topic
FROM google.storage.notifications
WHERE bucket = '{{ bucket }}' -- required
AND notification = '{{ notification }}' -- required
AND userProject = '{{ userProject }}';
Retrieves a list of notification subscriptions for a given bucket.
SELECT
items,
kind
FROM google.storage.notifications
WHERE bucket = '{{ bucket }}' -- required
AND userProject = '{{ userProject }}';
INSERT
examples
- insert
- Manifest
Creates a notification subscription for a given bucket.
INSERT INTO google.storage.notifications (
data__custom_attributes,
data__etag,
data__event_types,
data__id,
data__kind,
data__object_name_prefix,
data__payload_format,
data__selfLink,
data__topic,
bucket,
userProject
)
SELECT
'{{ custom_attributes }}',
'{{ etag }}',
'{{ event_types }}',
'{{ id }}',
'{{ kind }}',
'{{ object_name_prefix }}',
'{{ payload_format }}',
'{{ selfLink }}',
'{{ topic }}',
'{{ bucket }}',
'{{ userProject }}'
RETURNING
id,
custom_attributes,
etag,
event_types,
kind,
object_name_prefix,
payload_format,
selfLink,
topic
;
# Description fields are for documentation purposes
- name: notifications
props:
- name: bucket
value: string
description: Required parameter for the notifications resource.
- name: custom_attributes
value: object
description: >
An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.
- name: etag
value: string
description: >
HTTP 1.1 Entity tag for this subscription notification.
- name: event_types
value: array
description: >
If present, only send notifications about listed event types. If empty, sent notifications for all event types.
- name: id
value: string
description: >
The ID of the notification.
- name: kind
value: string
description: >
The kind of item this is. For notifications, this is always storage#notification.
default: storage#notification
- name: object_name_prefix
value: string
description: >
If present, only apply this notification configuration to object names that begin with this prefix.
- name: payload_format
value: string
description: >
The desired content of the Payload.
default: JSON_API_V1
- name: selfLink
value: string
description: >
The canonical URL of this notification.
- name: topic
value: string
description: >
The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
- name: userProject
value: string
DELETE
examples
- delete
Permanently deletes a notification subscription.
DELETE FROM google.storage.notifications
WHERE bucket = '{{ bucket }}' --required
AND notification = '{{ notification }}' --required
AND userProject = '{{ userProject }}';