2.2.3 (latest) 2.1.3 2.0.4 1.3.5 1.2.2 1.1.1 1.0.6 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 message `google.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. |
| `↳ allocations` | `array|Google\Protobuf\Internal\MapField` 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` | Enum of type [ShardBy](https://docs.cloud.google.com/php/docs/reference/cloud-appengine-admin/latest/V1.TrafficSplit.ShardBy). |

### 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` Enum of type [ShardBy](https://docs.cloud.google.com/php/docs/reference/cloud-appengine-admin/latest/V1.TrafficSplit.ShardBy). |

| **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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Internal\MapField` |   |

### setAllocations

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|Google\Protobuf\Internal\MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |