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/394/help/man/man1/gcloud_monitoring_snoozes_create.1
.TH "GCLOUD_MONITORING_SNOOZES_CREATE" 1



.SH "NAME"
.HP
gcloud monitoring snoozes create \- create a new snooze



.SH "SYNOPSIS"
.HP
\f5gcloud monitoring snoozes create\fR [\fB\-\-snooze\-from\-file\fR=\fIPATH_TO_FILE\fR] [\fB\-\-criteria\-filter\fR=\fICRITERIA_FILTER\fR\ \fB\-\-criteria\-policies\fR=\fICRITERIA_POLICIES\fR,[...]\ \fB\-\-display\-name\fR=\fIDISPLAY_NAME\fR\ \fB\-\-end\-time\fR=\fIEND_TIME\fR\ \fB\-\-start\-time\fR=\fISTART_TIME\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

Creates a new snooze. A snooze can be specified as a JSON/YAML value passed in
as a file through the \f5\-\-snooze\-from\-file\fR flag. A snooze can also be
specified through command line flags. If a snooze is specified through
\f5\-\-snooze\-from\-file\fR, and additional flags are supplied, the flags will
override the snooze's settings.

For information about the JSON/YAML format of a snooze:
https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.snoozes



.SH "EXAMPLES"

To create a snooze with command\-line options, run:

.RS 2m
$ gcloud monitoring snoozes create \e
    \-\-criteria\-policies=LIST_OF_POLICIES \-\-criteria\-filter=FILTER \e
    \-\-display\-name=DISPLAY_NAME \-\-start\-time=START_TIME \e
    \-\-end\-time=END_TIME
.RE

To create a snooze with a file, run:

.RS 2m
$ gcloud monitoring snoozes create \-\-snooze\-from\-file=MY\-FILE
.RE

Sample contents of MY\-FILE:

.RS 2m
criteria:
  policies:
  \- projects/MY\-PROJECT/alertPolicies/MY\-POLICY
  filter: 'resource.labels.zone="us\-central1\-a" AND resource.labels.instance_id="1234567890"'
interval:
  startTime: '2024\-03\-01T08:00:00Z'
  endTime: '2024\-03\-08T04:59:59.500Z'
displayName: New Snooze
.RE



.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-snooze\-from\-file\fR=\fIPATH_TO_FILE\fR

The path to a JSON or YAML file containing the snooze. Use a full or relative
path to a local file containing the value of snooze.

.TP 2m

Snooze Settings. If any of these are specified, they will overwrite fields in
the \f5\-\-snooze\-from\-file\fR flags if specified.


.RS 2m
.TP 2m
\fB\-\-criteria\-filter\fR=\fICRITERIA_FILTER\fR

Optional. When you define a Snooze, you can also define a filter for that
snooze. The filter is a string containing one or more key\-value pairs. The
string uses the standard https://google.aip.dev/160 filter syntax. If you define
a filter for a snooze, then the snooze can only apply to one alert policy. When
the snooze is active, incidents won't be created when the incident would have
key\-value pairs (labels) that match those specified by the filter in the
snooze. Snooze filters support resource, metric, and metadata labels. If
multiple labels are used, then they must be connected with an AND operator. For
example: resource.labels.instance_id="1234567890" AND
resource.labels.zone="us\-central1\-a" AND
metric.labels.instance_name="test_group" AND metadata.user_labels.foo="bar" AND
metadata.system_labels.region="us\-central1"

.TP 2m
\fB\-\-criteria\-policies\fR=\fICRITERIA_POLICIES\fR,[...]

The policies that the Snooze applies to. Exactly 1 alert policy is required if
\f5criteria\-filter\fR is specified at the same time.

.TP 2m
\fB\-\-display\-name\fR=\fIDISPLAY_NAME\fR

The display name for the Snooze.

.TP 2m
\fB\-\-end\-time\fR=\fIEND_TIME\fR

The start time for the Snooze.

.TP 2m
\fB\-\-start\-time\fR=\fISTART_TIME\fR

The start time for the Snooze.


.RE
.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"

These variants are also available:

.RS 2m
$ gcloud alpha monitoring snoozes create
.RE

.RS 2m
$ gcloud beta monitoring snoozes create
.RE