gcloud beta app services set-traffic

NAME
gcloud beta app services set-traffic - set traffic splitting settings
SYNOPSIS
gcloud beta app services set-traffic[SERVICES …]--splits=SPLITS,[SPLITS,…][--migrate][--split-by=SPLIT_BY; default="ip"][GCLOUD_WIDE_FLAG]
DESCRIPTION
(BETA) This command sets the traffic split of versions across aservice or a project.
EXAMPLES
To send all traffic to 'v2' of service 's1', run:
gcloudbetaappservicesset-traffics1--splits=v2=1

To split traffic evenly between 'v1' and 'v2' of service 's1', run:

gcloudbetaappservicesset-traffics1--splits=v2=.5,v1=.5

To split traffic across all services:

gcloudbetaappservicesset-traffic--splits=v2=.5,v1=.5
POSITIONAL ARGUMENTS
[SERVICES …]
The services to modify.
REQUIRED FLAGS
--splits=SPLITS,[SPLITS,…]
Key-value pairs describing what proportion of traffic should go to each version.The split values are added together and used as weights. The exact values do notmatter, only their relation to each other. For example, v1=2,v2=2 is equivalentto v1=.5,v2=.5
OPTIONAL FLAGS
--migrate
The migrate flag determines whether or not to use traffic migration during theoperation. Traffic migration will attempt to automatically migrate traffic fromthe previous version to the new version, giving the autoscaler time to respond.See the documentation here:https://cloud.google.com/appengine/docs/python/console/trafficmigrationfor more information.
--split-by=SPLIT_BY; default="ip"
Whether to split traffic based on cookie, IP address or random.SPLIT_BY must be one of:cookie,ip,random.
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:
gcloudappservicesset-traffic

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.