gcloud_alpha_monitoring_policies_update (1)
NAME
- gcloud alpha monitoring policies update - updates an alerting policy
SYNOPSIS
-
gcloud alpha monitoring policies update ALERT_POLICY [--fields=[field,...] | --display-name=DISPLAY_NAME --[no-]enabled --add-notification-channels=[NOTIFICATION-CHANNELS,...] | --clear-notification-channels | --remove-notification-channels=[NOTIFICATION-CHANNELS,...] | --set-notification-channels=[NOTIFICATION-CHANNELS,...] --documentation-format=DOCUMENTATION_FORMAT --documentation=DOCUMENTATION | --documentation-from-file=DOCUMENTATION_FROM_FILE --update-user-labels=[KEY=VALUE,...] --clear-user-labels | --remove-user-labels=[KEY,...]] [--policy=POLICY | --policy-from-file=POLICY_FROM_FILE] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) Updates an alerting policy.
-
- *
- If --fields is specified, the only the specified fields will be updated.
- *
- Else, the policy will be replaced with the provided policy. The policy can be modified further using the flags from the Policy Settings group below.
Otherwise, the policy will be updated with the values specified in the flags
from the Policy Settings group.
For information about the JSON/YAML format of an alerting policy:
cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies
POSITIONAL ARGUMENTS
-
-
Alert Policy resource - Name of the Alert Policy to be updated. This represents
a Cloud resource. (NOTE) Some attributes are not given arguments in this group
but can be set in other ways. To set the [project] attribute: provide the
argument [alert_policy] on the command line with a fully specified name; provide
the argument [--project] on the command line; set the property [core/project].
This must be specified.
-
- ALERT_POLICY
-
ID of the Alert Policy or fully qualified identifier for the Alert Policy.
-
-
Alert Policy resource - Name of the Alert Policy to be updated. This represents
a Cloud resource. (NOTE) Some attributes are not given arguments in this group
but can be set in other ways. To set the [project] attribute: provide the
argument [alert_policy] on the command line with a fully specified name; provide
the argument [--project] on the command line; set the property [core/project].
This must be specified.
FLAGS
-
-
At most one of these may be specified:
-
- --fields=[field,...]
-
The list of fields to update. Must specify --policy or
--policy-from-file if using this flag. field must be one of:
disabled, notificationChannels.
-
Policy Settings. If any of these are specified, they will overwrite fields in
the --policy or --policy-from-file flags if specified.
-
- --display-name=DISPLAY_NAME
-
The display name for the Alert Policy.
- --[no-]enabled
-
If the policy is enabled. Use --enabled to enable and
--no-enabled to disable.
-
These flags modify the member Notification Channels of this Alert Policy. At
most one of these may be specified:
-
- --add-notification-channels=[NOTIFICATION-CHANNELS,...]
-
Append the given values to the current Notification Channels.
- --clear-notification-channels
-
Empty the current Notification Channels.
- --remove-notification-channels=[NOTIFICATION-CHANNELS,...]
-
Remove the given values from the current Notification Channels.
- --set-notification-channels=[NOTIFICATION-CHANNELS,...]
-
Completely replace the current Notification Channels with the given values.
-
-
Documentation
-
- --documentation-format=DOCUMENTATION_FORMAT
-
The MIME type that should be used with --documentation or
--documentation-from-file. Currently, only "text/markdown" is
supported.
-
At most one of these may be specified:
-
- --documentation=DOCUMENTATION
-
The documentation to be included with the policy.
- --documentation-from-file=DOCUMENTATION_FROM_FILE
-
The path to a file containing the documentation to be included with the policy.
-
-
-
User Labels
-
- --update-user-labels=[KEY=VALUE,...]
-
List of label KEY=VALUE pairs to update. If a label exists its value is
modified, otherwise a new label is created.
Keys must start with a lowercase character and contain only hyphens (-), underscores (_), lowercase characters, and numbers. Values must contain only hyphens (-), underscores (_), lowercase characters, and numbers.
-
At most one of these may 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:
- $ gcloud alpha monitoring policies update --clear-user-labels
To set the labels to exactly "foo" and "baz":
-
$ gcloud alpha monitoring policies update --clear-user-labels \
--update-user-labels foo=bar,baz=qux
- --remove-user-labels=[KEY,...]
-
List of label keys to remove. If a label does not exist it is silently ignored.
-
-
-
-
-
At most one of these may be specified:
-
- --policy=POLICY
-
The policy as a string. In either JSON or YAML format.
- --policy-from-file=POLICY_FROM_FILE
-
The path to a JSON or YAML file containing the policy.
-
-
At most one of these may be specified:
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support