- NAME
-
- gcloud beta compute network-policies traffic-classification-rules update - updates a Compute Engine network policy rule
- SYNOPSIS
-
-
gcloud beta compute network-policies traffic-classification-rules update--network-policy=NETWORK_POLICY--priority=PRIORITY[--action=ACTION] [--description=DESCRIPTION] [--dest-ip-ranges=[DEST_IP_RANGE,…]] [--[no-]disabled] [--dscp-mode=DSCP_MODE] [--dscp-value=DSCP_VALUE] [--layer4-configs=[LAYER4_CONFIG,…]] [--network-policy-region=NETWORK_POLICY_REGION] [--new-priority=NEW_PRIORITY] [--src-ip-ranges=[SRC_IP_RANGE,…]] [--target-secure-tags=[TARGET_SECURE_TAGS,…]] [--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]] [--traffic-class=TRAFFIC_CLASS] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(BETA)gcloud beta compute network-policies traffic-classification-rules updateis used to update network policy rules. - EXAMPLES
-
To update a rule with priority
in a network policy with name10to change the description tomy-policy, run:new example rulegcloud beta compute network-policies traffic-classification-rules update --priority=10 --network-policy=my-policy --description="new example rule" - REQUIRED FLAGS
-
--network-policy=NETWORK_POLICY- Network policy ID with which to update rule.
--priority=PRIORITY- Priority of the rule to be updated. Valid in [1, 2147482647].
- OPTIONAL FLAGS
-
--action=ACTION-
Action to take if the request matches the match condition.
ACTIONmust be (only one value is supported):apply_traffic_classification. --description=DESCRIPTION- An optional, textual description for the rule.
--dest-ip-ranges=[DEST_IP_RANGE,…]- Destination IP ranges to match for this rule.
--[no-]disabled-
Use this flag to disable the rule. Disabled rules will not affect traffic. Use
--disabledto enable and--no-disabledto disable. --dscp-mode=DSCP_MODE-
When set to AUTO, the DSCP value will be picked automatically based on selected
traffic class. Otherwise, DSCP value must be specified.
DSCP_MODEmust be one of:auto,custom. --dscp-value=DSCP_VALUE- Custom DSCP value from 0-63 range.
--layer4-configs=[LAYER4_CONFIG,…]- A list of destination protocols and ports to which the network policy rule will apply.
--network-policy-region=NETWORK_POLICY_REGION-
Region of the network policy to operate on. Overrides the default
compute/regionproperty value for this command invocation. --new-priority=NEW_PRIORITY- New priority for the rule to update. Valid priority range: [1, 2147482647].
--src-ip-ranges=[SRC_IP_RANGE,…]- CIDR IP address range.
- An optional, list of target secure tags with a name of the format tagValues/ or full namespaced name
--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]- List of target service accounts for the rule.
--traffic-class=TRAFFIC_CLASS-
The traffic class that be applied to matching packet.
TRAFFIC_CLASSmust be one of:tc1,tc2,tc3,tc4,tc5,tc6.
- 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 helpfor details. - NOTES
-
This command is currently in beta and might change without notice. This variant
is also available:
gcloud alpha compute network-policies traffic-classification-rules update
gcloud beta compute network-policies traffic-classification-rules update
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-03-24 UTC.