HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/help/man/man1/gcloud_alpha_storage_buckets_notifications_create.1
.TH "GCLOUD_ALPHA_STORAGE_BUCKETS_NOTIFICATIONS_CREATE" 1



.SH "NAME"
.HP
gcloud alpha storage buckets notifications create \- create a notification configuration on a bucket



.SH "SYNOPSIS"
.HP
\f5gcloud alpha storage buckets notifications create\fR \fIURL\fR [\fB\-\-custom\-attributes\fR=[\fIKEY\fR=\fIVALUE\fR,...],\ \fB\-m\fR\ [\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-event\-types\fR=[\fINOTIFICATION_EVENT_TYPE\fR,...],\ \fB\-e\fR\ [\fINOTIFICATION_EVENT_TYPE\fR,...]] [\fB\-\-object\-prefix\fR=\fIOBJECT_PREFIX\fR,\ \fB\-p\fR\ \fIOBJECT_PREFIX\fR] [\fB\-\-payload\-format\fR=\fIPAYLOAD_FORMAT\fR,\ \fB\-f\fR\ \fIPAYLOAD_FORMAT\fR;\ default="json"] [\fB\-\-skip\-topic\-setup\fR,\ \fB\-s\fR] [\fB\-\-topic\fR=\fITOPIC\fR,\ \fB\-t\fR\ \fITOPIC\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(ALPHA)\fR \fBgcloud alpha storage buckets notifications create\fR creates a
notification configuration on a bucket, establishing a flow of event
notifications from Cloud Storage to a Cloud Pub/Sub topic. As part of creating
this flow, it also verifies that the destination Cloud Pub/Sub topic exists,
creating it if necessary, and verifies that the Cloud Storage bucket has
permission to publish events to that topic, granting the permission if
necessary.

If a destination Cloud Pub/Sub topic is not specified with the \f5\-t\fR flag,
Cloud Storage chooses a topic name in the default project whose ID is the same
as the bucket name. For example, if the default project ID specified is
\f5default\-project\fR and the bucket being configured is
\f5gs://example\-bucket\fR, the create command uses the Cloud Pub/Sub topic
\f5projects/default\-project/topics/example\-bucket\fR.

In order to enable notifications, your project's Cloud Storage service agent
(https://cloud.google.com/storage/docs/projects#service\-accounts) must have the
IAM permission "pubsub.topics.publish". This command checks to see if the
destination Cloud Pub/Sub topic grants the service agent this permission. If
not, the create command attempts to grant it.

A bucket can have up to 100 total notification configurations and up to 10
notification configurations set to trigger for a specific event.



.SH "EXAMPLES"

Send notifications of all changes to the bucket \f5example\-bucket\fR to the
Cloud Pub/Sub topic \f5projects/default\-project/topics/example\-bucket\fR:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    gs://example\-bucket
.RE

The same as the above but sends no notification payload:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    \-\-payload\-format=none gs://example\-bucket
.RE

Include custom metadata in notification payloads:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    \-\-custom\-attributes=key1:value1,key2:value2 gs://example\-bucket
.RE

Create a notification configuration that only sends an event when a new object
has been created or an object is deleted:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    \-\-event\-types=OBJECT_FINALIZE,OBJECT_DELETE gs://example\-bucket
.RE

Create a topic and notification configuration that sends events only when they
affect objects with the prefix \f5photos/\fR:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    \-\-object\-prefix=photos/ gs://example\-bucket
.RE

Specifies the destination topic ID \f5files\-to\-process\fR in the default
project:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    \-\-topic=files\-to\-process gs://example\-bucket
.RE

The same as above but specifies a Cloud Pub/Sub topic belonging to the specific
cloud project \f5example\-project\fR:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    \-\-topic=projects/example\-project/topics/files\-to\-process \e
    gs://example\-bucket
.RE

Skip creating a topic when creating the notification configuraiton:

.RS 2m
$ gcloud alpha storage buckets notifications create \e
    \-\-skip\-topic\-setup gs://example\-bucket
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
\fIURL\fR

URL of the bucket to create the notification configuration on.


.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-custom\-attributes\fR=[\fIKEY\fR=\fIVALUE\fR,...], \fB\-m\fR [\fIKEY\fR=\fIVALUE\fR,...]

Specifies key:value attributes that are appended to the set of attributes sent
to Cloud Pub/Sub for all events associated with this notification configuration.

.TP 2m
\fB\-\-event\-types\fR=[\fINOTIFICATION_EVENT_TYPE\fR,...], \fB\-e\fR [\fINOTIFICATION_EVENT_TYPE\fR,...]

Specify event type filters for this notification configuration. Cloud Storage
will send notifications of only these types. By default, Cloud Storage sends
notifications for all event types. * OBJECT_FINALIZE: An object has been
created. * OBJECT_METADATA_UPDATE: The metadata of an object has changed. *
OBJECT_DELETE: An object has been permanently deleted. * OBJECT_ARCHIVE: A live
version of an object has become a noncurrent version.
\fINOTIFICATION_EVENT_TYPE\fR must be one of: \fBOBJECT_ARCHIVE\fR,
\fBOBJECT_DELETE\fR, \fBOBJECT_FINALIZE\fR, \fBOBJECT_METADATA_UPDATE\fR.

.TP 2m
\fB\-\-object\-prefix\fR=\fIOBJECT_PREFIX\fR, \fB\-p\fR \fIOBJECT_PREFIX\fR

Specifies a prefix path for this notification configuration. Cloud Storage will
send notifications for only objects in the bucket whose names begin with the
prefix.

.TP 2m
\fB\-\-payload\-format\fR=\fIPAYLOAD_FORMAT\fR, \fB\-f\fR \fIPAYLOAD_FORMAT\fR; default="json"

Specifies the payload format of notification messages. Notification details are
available in the message attributes. 'none' sends no payload.
\fIPAYLOAD_FORMAT\fR must be one of: \fBjson\fR, \fBnone\fR.

.TP 2m
\fB\-\-skip\-topic\-setup\fR, \fB\-s\fR

Skips creation and permission assignment of the Cloud Pub/Sub topic. This is
useful if the caller does not have permission to access the topic in question,
or if the topic already exists and has the appropriate publish permission
assigned.

.TP 2m
\fB\-\-topic\fR=\fITOPIC\fR, \fB\-t\fR \fITOPIC\fR

Specifies the Cloud Pub/Sub topic to send notifications to. If not specified,
this command chooses a topic whose project is your default project and whose ID
is the same as the Cloud Storage bucket name.


.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.



.SH "NOTES"

This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. This variant is also available:

.RS 2m
$ gcloud storage buckets notifications create
.RE