1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-18 14:56:05 +00:00

gcloud: Wed Dec 10 10:54:29 UTC 2025

This commit is contained in:
Automated 2025-12-10 10:54:29 +00:00
parent 7b14250313
commit 6d07e70b12
313 changed files with 11521 additions and 1088 deletions

View file

@ -36,6 +36,9 @@ GROUPS
metrics-scopes
(BETA) Manage Cloud Monitoring Metrics Scopes.
policies
(BETA) Manage Cloud Monitoring alerting policies.
snoozes
(BETA) Manage Cloud Monitoring snoozes.

View file

@ -0,0 +1,96 @@
NAME
gcloud beta monitoring policies conditions create - create a condition in
an alerting policy
SYNOPSIS
gcloud beta monitoring policies conditions create ALERT_POLICY
[--aggregation=AGGREGATION
--condition-display-name=CONDITION_DISPLAY_NAME
--condition-filter=CONDITION_FILTER
--duration=DURATION --if=IF_VALUE --trigger-count=TRIGGER_COUNT
| --trigger-percent=TRIGGER_PERCENT]
[--condition=CONDITION | --condition-from-file=PATH_TO_FILE]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Create a condition in an alerting policy.
POSITIONAL ARGUMENTS
Alert Policy resource - Name of the Alert Policy to add a condition to.
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.
To set the policy attribute:
▸ provide the argument alert_policy on the command line.
FLAGS
Condition Settings. This will add a condition to the created policy. If
any conditions are already specified, this condition will be appended.
--aggregation=AGGREGATION
Specifies an Aggregation message as a JSON/YAML value to be applied
to the condition. For more information about the format:
https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies
--condition-display-name=CONDITION_DISPLAY_NAME
The display name for the condition.
--condition-filter=CONDITION_FILTER
Specifies the "filter" in a metric absence or metric threshold
condition.
--duration=DURATION
The duration (e.g. "60s", "2min", etc.) that the condition must hold
in order to trigger as true.
--if=IF_VALUE
One of "absent", "< THRESHOLD", "> THRESHOLD" where "THRESHOLD" is an
integer or float.
At most one of these can be specified:
--trigger-count=TRIGGER_COUNT
The absolute number of time series that must fail the predicate for
the condition to be triggered.
--trigger-percent=TRIGGER_PERCENT
The percentage of time series that must fail the predicate for the
condition to be triggered.
At most one of these can be specified:
--condition=CONDITION
The condition as a string. In either JSON or YAML format.
--condition-from-file=PATH_TO_FILE
The path to a JSON or YAML file containing the condition. Use a full
or relative path to a local file containing the value of condition.
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. These
variants are also available:
$ gcloud monitoring policies conditions create
$ gcloud alpha monitoring policies conditions create

View file

@ -0,0 +1,60 @@
NAME
gcloud beta monitoring policies conditions delete - delete a condition in
an alerting policy
SYNOPSIS
gcloud beta monitoring policies conditions delete
(CONDITION : --policy=POLICY) [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Delete a condition in an alerting policy. If the specified condition
does not exist, this command will fail with an error. This will not delete
the policy if no conditions exist.
POSITIONAL ARGUMENTS
Condition resource - The name of the Condition to delete. The arguments in
this group can be used to specify the attributes of this 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 condition 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.
CONDITION
ID of the condition or fully qualified identifier for the condition.
To set the condition attribute:
▸ provide the argument condition on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--policy=POLICY
Name of the alerting policy.
To set the policy attribute:
▸ provide the argument condition on the command line with a fully
specified name;
▸ provide the argument --policy on the command line.
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. These
variants are also available:
$ gcloud monitoring policies conditions delete
$ gcloud alpha monitoring policies conditions delete

View file

@ -0,0 +1,58 @@
NAME
gcloud beta monitoring policies conditions describe - describe a condition
in a Cloud Monitoring alerting policy
SYNOPSIS
gcloud beta monitoring policies conditions describe
(CONDITION : --policy=POLICY) [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Describe a condition in a Cloud Monitoring alerting policy.
POSITIONAL ARGUMENTS
Condition resource - The name of the Condition to describe. The arguments
in this group can be used to specify the attributes of this 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 condition 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.
CONDITION
ID of the condition or fully qualified identifier for the condition.
To set the condition attribute:
▸ provide the argument condition on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--policy=POLICY
Name of the alerting policy.
To set the policy attribute:
▸ provide the argument condition on the command line with a fully
specified name;
▸ provide the argument --policy on the command line.
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. These
variants are also available:
$ gcloud monitoring policies conditions describe
$ gcloud alpha monitoring policies conditions describe

View file

@ -0,0 +1,41 @@
NAME
gcloud beta monitoring policies conditions - manage Cloud Monitoring
alerting policy conditions
SYNOPSIS
gcloud beta monitoring policies conditions COMMAND [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Manage Monitoring alerting policies conditions.
More information can be found here:
https://cloud.google.com/monitoring/api/v3/
GCLOUD WIDE FLAGS
These flags are available to all commands: --help.
Run $ gcloud help for details.
COMMANDS
COMMAND is one of the following:
create
(BETA) Create a condition in an alerting policy.
delete
(BETA) Delete a condition in an alerting policy.
describe
(BETA) Describe a condition in a Cloud Monitoring alerting policy.
update
(BETA) Update a condition in an alerting policy.
NOTES
This command is currently in beta and might change without notice. These
variants are also available:
$ gcloud monitoring policies conditions
$ gcloud alpha monitoring policies conditions

View file

@ -0,0 +1,79 @@
NAME
gcloud beta monitoring policies conditions update - update a condition in
an alerting policy
SYNOPSIS
gcloud beta monitoring policies conditions update
(CONDITION : --policy=POLICY) [--display-name=DISPLAY_NAME]
[--if=IF_VALUE]
[--trigger-count=TRIGGER_COUNT | --trigger-percent=TRIGGER_PERCENT]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Update a condition in an alerting policy.
POSITIONAL ARGUMENTS
Condition resource - The name of the Condition to update. The arguments in
this group can be used to specify the attributes of this 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 condition 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.
CONDITION
ID of the condition or fully qualified identifier for the condition.
To set the condition attribute:
▸ provide the argument condition on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--policy=POLICY
Name of the alerting policy.
To set the policy attribute:
▸ provide the argument condition on the command line with a fully
specified name;
▸ provide the argument --policy on the command line.
FLAGS
--display-name=DISPLAY_NAME
The display name for the Condition.
--if=IF_VALUE
One of "absent", "< THRESHOLD", "> THRESHOLD" where "THRESHOLD" is an
integer or float.
At most one of these can be specified:
--trigger-count=TRIGGER_COUNT
The absolute number of time series that must fail the predicate for
the condition to be triggered.
--trigger-percent=TRIGGER_PERCENT
The percentage of time series that must fail the predicate for the
condition to be triggered.
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. These
variants are also available:
$ gcloud monitoring policies conditions update
$ gcloud alpha monitoring policies conditions update

View file

@ -0,0 +1,171 @@
NAME
gcloud beta monitoring policies create - create a new alerting policy
SYNOPSIS
gcloud beta monitoring policies create
[--notification-channels=[NOTIFICATION_CHANNELS,...]]
[--aggregation=AGGREGATION
--condition-display-name=CONDITION_DISPLAY_NAME
--condition-filter=CONDITION_FILTER
--duration=DURATION --if=IF_VALUE --trigger-count=TRIGGER_COUNT
| --trigger-percent=TRIGGER_PERCENT]
[--combiner=COMBINER --display-name=DISPLAY_NAME --no-enabled
--user-labels=[KEY=VALUE,...]
--documentation-format=DOCUMENTATION_FORMAT;
default="text/markdown" --documentation=DOCUMENTATION
| --documentation-from-file=PATH_TO_FILE]
[--policy=POLICY | --policy-from-file=PATH_TO_FILE]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Creates a new alerting policy. An alert policy can be specified as a
JSON/YAML value passed in as a string through the --policy flag or as a
file through the --policy-from-file flag. A basic policy can also be
specified through command line flags. If a policy is specified through
--policy or --policy-from-file, and additional flags are supplied, the
flags will override the policy's settings and a specified condition will be
appended to the list of conditions.
For information about the JSON/YAML format of an alerting policy:
https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies
FLAGS
Notification Channel resource - Names of one or more Notification Channels
to be added to the policy. These should be the resource names (not the
display name) of the channels. Acceptable formats are:
◆ Channel Name: my-channel
▸ The project specified through --project or the default project
defined by the core/project property will be used, in that order.
◆ Channel Relative Name:
projects/my-project/notificationChannels/channel-id0
◆ Channel URI:
https://monitoring.googleapis.com/v3/projects/my-project/notificationChannels/channel-id0
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 --notification-channels on the command line with
a fully specified name;
◆ provide the argument --project on the command line;
◆ set the property core/project.
--notification-channels=[NOTIFICATION_CHANNELS,...]
IDs of the Notification Channels or fully qualified identifiers for
the Notification Channels.
To set the notification_channels attribute:
▸ provide the argument --notification-channels on the command line.
Condition Settings. This will add a condition to the created policy. If
any conditions are already specified, this condition will be appended.
--aggregation=AGGREGATION
Specifies an Aggregation message as a JSON/YAML value to be applied
to the condition. For more information about the format:
https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies
--condition-display-name=CONDITION_DISPLAY_NAME
The display name for the condition.
--condition-filter=CONDITION_FILTER
Specifies the "filter" in a metric absence or metric threshold
condition.
--duration=DURATION
The duration (e.g. "60s", "2min", etc.) that the condition must hold
in order to trigger as true.
--if=IF_VALUE
One of "absent", "< THRESHOLD", "> THRESHOLD" where "THRESHOLD" is an
integer or float.
At most one of these can be specified:
--trigger-count=TRIGGER_COUNT
The absolute number of time series that must fail the predicate for
the condition to be triggered.
--trigger-percent=TRIGGER_PERCENT
The percentage of time series that must fail the predicate for the
condition to be triggered.
Policy Settings. If any of these are specified, they will overwrite fields
in the --policy or --policy-from-file flags if specified.
--combiner=COMBINER
The combiner for the Alert Policy. COMBINER must be one of:
AND
An incident is created only if all conditions are met
simultaneously. This combiner is satisfied if all conditions are
met, even if they are met on completely different resources.
AND_WITH_MATCHING_RESOURCE
Combine conditions using logical AND operator, but unlike the
regular AND option, an incident is created only if all conditions
are met simultaneously on at least one resource.
COMBINE_UNSPECIFIED
An unspecified combiner
OR
An incident is created if any of the listed conditions is met.
--display-name=DISPLAY_NAME
The display name for the Alert Policy.
--enabled
If the policy is enabled. Enabled by default, use --no-enabled to
disable.
--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, and numbers. Values must
contain only hyphens (-), underscores (_), lowercase characters, and
numbers.
If the policy was given as a JSON/YAML object from a string or file,
this flag will replace the labels value in the given policy.
Documentation
--documentation-format=DOCUMENTATION_FORMAT; default="text/markdown"
The MIME type that should be used with --documentation or
--documentation-from-file. Currently, only "text/markdown" is
supported.
At most one of these can be specified:
--documentation=DOCUMENTATION
The documentation to be included with the policy.
--documentation-from-file=PATH_TO_FILE
The path to a file containing the documentation to be included
with the policy. Use a full or relative path to a local file
containing the value of documentation.
At most one of these can be specified:
--policy=POLICY
The policy as a string. In either JSON or YAML format.
--policy-from-file=PATH_TO_FILE
The path to a JSON or YAML file containing the policy. Use a full or
relative path to a local file containing the value of policy.
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. These
variants are also available:
$ gcloud monitoring policies create
$ gcloud alpha monitoring policies create

View file

@ -0,0 +1,49 @@
NAME
gcloud beta monitoring policies delete - delete a Cloud Monitoring alerting
policy
SYNOPSIS
gcloud beta monitoring policies delete POLICY [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Delete a Monitoring alerting policy.
POSITIONAL ARGUMENTS
Policy resource - The alerting policy to delete. 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 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.
POLICY
ID of the policy or fully qualified identifier for the policy.
To set the policy attribute:
▸ provide the argument policy on the command line.
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.
API REFERENCE
This command uses the monitoring/v3 API. The full documentation for this
API can be found at: https://cloud.google.com/monitoring/api/
NOTES
This command is currently in beta and might change without notice. These
variants are also available:
$ gcloud monitoring policies delete
$ gcloud alpha monitoring policies delete

View file

@ -0,0 +1,48 @@
NAME
gcloud beta monitoring policies describe - describe an alerting policy
SYNOPSIS
gcloud beta monitoring policies describe POLICY [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Describe an alerting policy.
POSITIONAL ARGUMENTS
Policy resource - The alerting policy to describe. 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 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.
POLICY
ID of the policy or fully qualified identifier for the policy.
To set the policy attribute:
▸ provide the argument policy on the command line.
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.
API REFERENCE
This command uses the monitoring/v3 API. The full documentation for this
API can be found at: https://cloud.google.com/monitoring/api/
NOTES
This command is currently in beta and might change without notice. These
variants are also available:
$ gcloud monitoring policies describe
$ gcloud alpha monitoring policies describe

View file

@ -0,0 +1,52 @@
NAME
gcloud beta monitoring policies - manage Cloud Monitoring alerting policies
SYNOPSIS
gcloud beta monitoring policies GROUP | COMMAND [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Manage Monitoring alerting policies.
More information can be found here:
https://cloud.google.com/monitoring/api/v3/
GCLOUD WIDE FLAGS
These flags are available to all commands: --help.
Run $ gcloud help for details.
GROUPS
GROUP is one of the following:
conditions
(BETA) Manage Cloud Monitoring alerting policy conditions.
COMMANDS
COMMAND is one of the following:
create
(BETA) Create a new alerting policy.
delete
(BETA) Delete a Cloud Monitoring alerting policy.
describe
(BETA) Describe an alerting policy.
list
(BETA) List alerting policies.
migrate
(BETA) Migrate a Prometheus configuration file to Cloud Monitoring.
update
(BETA) Updates an alerting policy.
NOTES
This command is currently in beta and might change without notice. These
variants are also available:
$ gcloud monitoring policies
$ gcloud alpha monitoring policies

View file

@ -0,0 +1,87 @@
NAME
gcloud beta monitoring policies list - list alerting policies
SYNOPSIS
gcloud beta monitoring policies list [--filter=EXPRESSION] [--limit=LIMIT]
[--page-size=PAGE_SIZE] [--sort-by=[FIELD,...]] [--uri]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) List alerting policies.
EXAMPLES
To order your results first by the team key in user_labels and then the
policy's display name:
$ gcloud beta monitoring policies list \
--sort-by user_label.team,display_name
To order your results in reverse order, you can add either '~' or '-' in
front of the field name:
$ gcloud beta monitoring policies list --sort-by "-display_name"
To return results with non-empty display names or descriptions:
$ gcloud beta monitoring policies list \
--filter "(NOT display_name.empty OR NOT description.empty)"
To return results whose descriptions contain the word 'cloud':
$ gcloud beta monitoring policies list --filter "description:(cloud)"
Please find all supported fields at
https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#alertpolicy.
LIST COMMAND FLAGS
--filter=EXPRESSION
Apply a Boolean filter EXPRESSION to each resource item to be listed.
If the expression evaluates True, then that item is listed. For more
details and examples of filter expressions, run $ gcloud topic filters.
This flag interacts with other flags that are applied in this order:
--flatten, --sort-by, --filter, --limit.
--limit=LIMIT
Maximum number of resources to list. The default is unlimited. This
flag interacts with other flags that are applied in this order:
--flatten, --sort-by, --filter, --limit.
--page-size=PAGE_SIZE
Some services group resource list output into pages. This flag
specifies the maximum number of resources per page. The default is
determined by the service if it supports paging, otherwise it is
unlimited (no paging). Paging may be applied before or after --filter
and --limit depending on the service.
--sort-by=[FIELD,...]
Comma-separated list of resource field key names to sort by. The
default order is ascending. Prefix a field with ``~'' for descending
order on that field. This flag interacts with other flags that are
applied in this order: --flatten, --sort-by, --filter, --limit.
--uri
Print a list of resource URIs instead of the default output, and change
the command output to a list of URIs. If this flag is used with
--format, the formatting is applied on this URI list. To display URIs
alongside other keys instead, use the uri() transform.
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.
API REFERENCE
This command uses the monitoring/v3 API. The full documentation for this
API can be found at: https://cloud.google.com/monitoring/api/
NOTES
This command is currently in beta and might change without notice. These
variants are also available:
$ gcloud monitoring policies list
$ gcloud alpha monitoring policies list

View file

@ -0,0 +1,45 @@
NAME
gcloud beta monitoring policies migrate - migrate a Prometheus
configuration file to Cloud Monitoring
SYNOPSIS
gcloud beta monitoring policies migrate
[--channels-from-prometheus-alertmanager-yaml=PROMETHEUS_ALERT_MANAGER_FILE_PATH --policies-from-prometheus-alert-rules-yaml=[PROMETHEUS_ALERT_RULE_FILE_PATHS,
...]] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Creates new alerting policies and/or notification channels based on
provided Prometheus files. The rules YAML file, which holds the alert
rules, must be specified as a file through the
--policies-from-prometheus-alert-rules-yaml flag.
FLAGS
--channels-from-prometheus-alertmanager-yaml=PROMETHEUS_ALERT_MANAGER_FILE_PATH
Prometheus alert manager YAML file to be converted to Cloud Monitoring
notification channels. Specifying this flag with the
--policies-from-prometheus-alert-rules-yaml flag puts the newly created
notification channels into the translated Alert Policies' definition.
Use a full or relative path to a local file containing the value of
channels_from_prometheus_alertmanager_yaml.
--policies-from-prometheus-alert-rules-yaml=[PROMETHEUS_ALERT_RULE_FILE_PATHS,...]
One or more Prometheus alert rule YAML files (separated by commas if
multiple) to be converted to Cloud Alerting Policies. Example:
--policies-from-prometheus-alert-rules-yaml=rules_1.yaml,rules_2.yaml
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. These
variants are also available:
$ gcloud monitoring policies migrate
$ gcloud alpha monitoring policies migrate

View file

@ -0,0 +1,183 @@
NAME
gcloud beta monitoring policies update - updates an alerting policy
SYNOPSIS
gcloud beta monitoring policies update ALERT_POLICY
[--fields=[field,...] | --combiner=COMBINER --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=PATH_TO_FILE
--update-user-labels=[KEY=VALUE,...] --clear-user-labels
| --remove-user-labels=[KEY,...]]
[--policy=POLICY | --policy-from-file=PATH_TO_FILE]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Updates an alerting policy.
If --policy or --policy-from-file are specified:
▪ 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:
https://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.
To set the policy attribute:
▸ provide the argument alert_policy on the command line.
FLAGS
At most one of these can 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.
--combiner=COMBINER
The combiner for the Alert Policy. COMBINER must be one of:
AND
An incident is created only if all conditions are met
simultaneously. This combiner is satisfied if all conditions
are met, even if they are met on completely different
resources.
AND_WITH_MATCHING_RESOURCE
Combine conditions using logical AND operator, but unlike the
regular AND option, an incident is created only if all
conditions are met simultaneously on at least one resource.
COMBINE_UNSPECIFIED
An unspecified combiner
OR
An incident is created if any of the listed conditions is met.
--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 can 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 can be specified:
--documentation=DOCUMENTATION
The documentation to be included with the policy.
--documentation-from-file=PATH_TO_FILE
The path to a file containing the documentation to be included
with the policy. Use a full or relative path to a local file
containing the value of documentation.
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 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:
$ gcloud beta monitoring policies update --clear-user-labels
To remove all existing labels and create two new labels, foo
and baz:
$ gcloud beta 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. If --update-user-labels is also specified
then --update-user-labels is applied first.
At most one of these can be specified:
--policy=POLICY
The policy as a string. In either JSON or YAML format.
--policy-from-file=PATH_TO_FILE
The path to a JSON or YAML file containing the policy. Use a full or
relative path to a local file containing the value of policy.
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. These
variants are also available:
$ gcloud monitoring policies update
$ gcloud alpha monitoring policies update