gcloud alpha monitoring channels create

NAME
gcloud alpha monitoring channels create - create a new notification channel
SYNOPSIS
gcloud alpha monitoring channels create[--channel-content=CHANNEL_CONTENT    |--channel-content-from-file=PATH_TO_FILE][--channel-labels=[KEY=VALUE,…]--description=DESCRIPTION--display-name=DISPLAY_NAME--no-enabled--type=TYPE--user-labels=[KEY=VALUE,…]][GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) Creates a new notification channel. A channel can bespecified as JSON/YAML passed in as a string through the--channel-content flag or as a file through the--channel-content-from-file flag. A basic channel can also bespecified through command line flags. If a channel is specified through--channel-content or--channel-content-from-file, andadditional flags are supplied, the flags will override the given channel'ssettings.

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

Additional documentation can for this operation can be found at:https://cloud.google.com/monitoring/alerts/using-channels-api

EXAMPLES
The following commands setup both email and SMS notification channels for theteam lead. Note that the display name and description focus on thepurpose/semantics of the channel rather than its destination. This is abest-practice that facilitates swapping/updating notification channels in-place(such as when users change teams, projects, roles, companies, etc.) with minimalimpact to the alerting policies that reference the existing channels. It is alsoa best practice to supply at least two channels of different types for a givenperson.
gcloudalphamonitoringchannelscreate--display-name="Foo Team Lead (Primary)"--description="Primary contact method for the Foo team lead"--type=email--user-labels=team=foo,role=lead,ord=1--channel-labels=email_address=user@somedomain.tld
gcloudalphamonitoringchannelscreate--display-name="Foo Team Lead (Secondary)"--description="Secondary contact method for the Foo team lead"--type=sms--user-labels=team=foo,role=lead,ord=2--channel-labels=number=123-456-7890
FLAGS
At most one of these can be specified:
--channel-content=CHANNEL_CONTENT
The channel-content as a string. In either JSON or YAML format.
--channel-content-from-file=PATH_TO_FILE
The path to a JSON or YAML file containing the channel-content. Use a full orrelative path to a local file containing the value of channel_content.
Notification channel settings
--channel-labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to add.

Keys must start with a lowercase character and contain only hyphens(-), underscores (_), lowercase characters, andnumbers.

These are configuration fields that define the channel and its behavior.If thechannel was given as a JSON/YAML object from a string or file, this flag willreplace the labels value in the given channel.

--description=DESCRIPTION
An optional description for the channel.
--display-name=DISPLAY_NAME
The display name for the channel.
--enabled
Whether notifications are forwarded to the described channel. Enabled bydefault, use--no-enabled to disable.
--type=TYPE
The type of the notification channel. This field matches the value of theNotificationChannelDescriptor type field.
--user-labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to add.

Keys must start with a lowercase character and contain only hyphens(-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers.

If the channel was given as a JSON/YAML object from a string or file, this flagwill replace the labels value in the given channel.

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$gcloud help for details.

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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.