Reference documentation and code samples for the Google Cloud Appengine Admin V1 Client class TrafficSplit.
Traffic routing configuration for versions within a single service. Traffic
splits define how traffic directed to the service is assigned to versions.
Generated from protobuf messagegoogle.appengine.v1.TrafficSplit
Namespace
Google \ Cloud \ AppEngine \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ shard_by
int
Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are changed.
Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up to three decimal places is supported for cookie-based splits.
getShardBy
Mechanism used to determine which version a request is sent to.
The traffic selection algorithm will
be stable for either type until allocations are changed.
Returns
Type
Description
int
setShardBy
Mechanism used to determine which version a request is sent to.
The traffic selection algorithm will
be stable for either type until allocations are changed.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getAllocations
Mapping from version IDs within the service to fractional
(0.000, 1] allocations of traffic for that version. Each version can
be specified only once, but some versions in the service may not
have any traffic allocation. Services that have traffic allocated
cannot be deleted until either the service is deleted or
their traffic allocation is removed. Allocations must sum to 1.
Up to two decimal place precision is supported for IP-based splits and
up to three decimal places is supported for cookie-based splits.
Mapping from version IDs within the service to fractional
(0.000, 1] allocations of traffic for that version. Each version can
be specified only once, but some versions in the service may not
have any traffic allocation. Services that have traffic allocated
cannot be deleted until either the service is deleted or
their traffic allocation is removed. Allocations must sum to 1.
Up to two decimal place precision is supported for IP-based splits and
up to three decimal places is supported for cookie-based splits.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Appengine Admin V1 Client - Class TrafficSplit (2.0.4)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.4 (latest)](/php/docs/reference/cloud-appengine-admin/latest/V1.TrafficSplit)\n- [2.0.3](/php/docs/reference/cloud-appengine-admin/2.0.3/V1.TrafficSplit)\n- [1.3.5](/php/docs/reference/cloud-appengine-admin/1.3.5/V1.TrafficSplit)\n- [1.2.2](/php/docs/reference/cloud-appengine-admin/1.2.2/V1.TrafficSplit)\n- [1.1.1](/php/docs/reference/cloud-appengine-admin/1.1.1/V1.TrafficSplit)\n- [1.0.6](/php/docs/reference/cloud-appengine-admin/1.0.6/V1.TrafficSplit) \nReference documentation and code samples for the Google Cloud Appengine Admin V1 Client class TrafficSplit.\n\nTraffic routing configuration for versions within a single service. Traffic\nsplits define how traffic directed to the service is assigned to versions.\n\nGenerated from protobuf message `google.appengine.v1.TrafficSplit`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ AppEngine \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getShardBy\n\nMechanism used to determine which version a request is sent to.\n\nThe traffic selection algorithm will\nbe stable for either type until allocations are changed.\n\n### setShardBy\n\nMechanism used to determine which version a request is sent to.\n\nThe traffic selection algorithm will\nbe stable for either type until allocations are changed.\n\n### getAllocations\n\nMapping from version IDs within the service to fractional\n(0.000, 1\\] allocations of traffic for that version. Each version can\nbe specified only once, but some versions in the service may not\nhave any traffic allocation. Services that have traffic allocated\ncannot be deleted until either the service is deleted or\ntheir traffic allocation is removed. Allocations must sum to 1.\n\nUp to two decimal place precision is supported for IP-based splits and\nup to three decimal places is supported for cookie-based splits.\n\n### setAllocations\n\nMapping from version IDs within the service to fractional\n(0.000, 1\\] allocations of traffic for that version. Each version can\nbe specified only once, but some versions in the service may not\nhave any traffic allocation. Services that have traffic allocated\ncannot be deleted until either the service is deleted or\ntheir traffic allocation is removed. Allocations must sum to 1.\n\nUp to two decimal place precision is supported for IP-based splits and\nup to three decimal places is supported for cookie-based splits."]]