gcloud beta monitoring channels update

NAME
gcloud beta monitoring channels update - update a notification channel
SYNOPSIS
gcloud beta monitoring channels updateCHANNEL[--channel-content=CHANNEL_CONTENT    |--channel-content-from-file=PATH_TO_FILE][--fields=[field,…]    |--description=DESCRIPTION--display-name=DISPLAY_NAME--[no-]enabled--type=TYPE--update-channel-labels=[KEY=VALUE,…]--clear-channel-labels    |--remove-channel-labels=[KEY,…]--update-user-labels=[KEY=VALUE,…]--clear-user-labels    |--remove-user-labels=[KEY,…]][GCLOUD_WIDE_FLAG]
DESCRIPTION
(BETA) Updates a notification channel.

If--channel-content or--channel-content-from-fileare specified:

  • --fields can be specified; only the specified fields will be updated.
  • Alternatively, the channel will be replaced with the provided channel. Thechannel can be modified further using the flags from the notification channelsettings group below.

Otherwise, the channel will be updated with the values specified in the flagsfrom the notification channel settings group.

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

Note: When specifying the Channel as a YAML/JSON, the use ofchannelLabels as an alternative name forlabels issupported.

EXAMPLES
The following command updates an existing email notification channel to pointfrom its original email address to "newaddress@newdomain.tld":
gcloudbetamonitoringchannelsupdate"projects/12345/notificationChannels/67890"--update-channel-labels=email_address=newaddress@newdomain.tld
POSITIONAL ARGUMENTS
Notification Channel resource - Name of the Notification Channel to update Thisrepresents a Cloud resource. (NOTE) Some attributes are not given arguments inthis group but can be set in other ways.

To set theproject attribute:

  • provide the argumentchannel on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

CHANNEL
ID of the Notification Channel or fully qualified identifier for theNotification Channel.

To set thenotification_channels attribute:

  • provide the argumentchannel on the command line.
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.
At most one of these can be specified:
--fields=[field,…]
The list of fields to update. Must specify--channel-content or--channel-content-from-file if using this flag.
Notification channel settings
--description=DESCRIPTION
An optional description for the channel.
--display-name=DISPLAY_NAME
The display name for the channel.
--[no-]enabled
Whether notifications are forwarded to the described channel. Use--enabled to enable and--no-enabled to disable.
--type=TYPE
The type of the notification channel. This field matches the value of theNotificationChannelDescriptor type field.
Configuration Fields: Key-Value pairs that define the channel and its behavior.
--update-channel-labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to update. If a label exists, its value ismodified. Otherwise, a new label is created.

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

At most one of these can be specified:
--clear-channel-labels
Remove all labels. If--update-channel-labels is also specifiedthen--clear-channel-labels is applied first.

For example, to remove all labels:

gcloudbetamonitoringchannelsupdate--clear-channel-labels

To remove all existing labels and create two new labels,foo andbaz:

gcloudbetamonitoringchannelsupdate--clear-channel-labels--update-channel-labelsfoo=bar,baz=qux
--remove-channel-labels=[KEY,…]
List of label keys to remove. If a label does not exist it is silently ignored.If--update-channel-labels is also specified then--update-channel-labels is applied first.
User Labels
--update-user-labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to update. If a label exists, its value ismodified. Otherwise, a new label is created.

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.

At most one of these can be specified:
--clear-user-labels
Remove all labels. If--update-user-labels is also specified then--clear-user-labels is applied first.

For example, to remove all labels:

gcloudbetamonitoringchannelsupdate--clear-user-labels

To remove all existing labels and create two new labels,foo andbaz:

gcloudbetamonitoringchannelsupdate--clear-user-labels--update-user-labelsfoo=bar,baz=qux
--remove-user-labels=[KEY,…]
List of label keys to remove. If a label does not exist it is silently ignored.If--update-user-labels is also specified then--update-user-labels is applied first.
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 beta and might change without notice. This variantis also available:
gcloudalphamonitoringchannelsupdate

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.