# Google Cloud Network Services V1 Client - Class ServiceLbPolicy (0.8.2)

0.8.2 (latest) 0.8.1 0.7.1 0.6.1 0.5.0 0.4.0 0.3.0 0.2.3 0.1.1 Reference documentation and code samples for the Google Cloud Network Services V1 Client class ServiceLbPolicy.

ServiceLbPolicy holds global load balancing and traffic distribution
configuration that can be applied to a BackendService.

Generated from protobuf message `google.cloud.networkservices.v1.ServiceLbPolicy`

## Namespace

Google \\ Cloud \\ NetworkServices \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. Name of the ServiceLbPolicy resource. It matches pattern `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}`. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when this resource was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when this resource was last updated. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Set of label tags associated with the ServiceLbPolicy resource. |
| `↳ description` | `string` Optional. A free-text description of the resource. Max length 1024 characters. |
| `↳ load_balancing_algorithm` | `int` Optional. The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION. |
| `↳ auto_capacity_drain` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.AutoCapacityDrain` Optional. Configuration to automatically move traffic away for unhealthy IG/NEG for the associated Backend Service. |
| `↳ failover_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.FailoverConfig` Optional. Configuration related to health based failover. |
| `↳ isolation_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.IsolationConfig` Optional. Configuration to provide isolation support for the associated Backend Service. |

### getName

Identifier. Name of the ServiceLbPolicy resource. It matches pattern
`projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Identifier. Name of the ServiceLbPolicy resource. It matches pattern
`projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getCreateTime

Output only. The timestamp when this resource was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The timestamp when this resource was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getUpdateTime

Output only. The timestamp when this resource was last updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The timestamp when this resource was last updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getLabels

Optional. Set of label tags associated with the ServiceLbPolicy resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Optional. Set of label tags associated with the ServiceLbPolicy resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getDescription

Optional. A free-text description of the resource. Max length 1024
characters.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDescription

Optional. A free-text description of the resource. Max length 1024
characters.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getLoadBalancingAlgorithm

Optional. The type of load balancing algorithm to be used. The default
behavior is WATERFALL_BY_REGION.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [LoadBalancingAlgorithm](https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.LoadBalancingAlgorithm). |

### setLoadBalancingAlgorithm

Optional. The type of load balancing algorithm to be used. The default
behavior is WATERFALL_BY_REGION.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [LoadBalancingAlgorithm](https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.LoadBalancingAlgorithm). |

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

### getAutoCapacityDrain

Optional. Configuration to automatically move traffic away for unhealthy
IG/NEG for the associated Backend Service.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.AutoCapacityDrain|null` |   |

### hasAutoCapacityDrain

### clearAutoCapacityDrain

### setAutoCapacityDrain

Optional. Configuration to automatically move traffic away for unhealthy
IG/NEG for the associated Backend Service.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.AutoCapacityDrain` |

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

### getFailoverConfig

Optional. Configuration related to health based failover.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.FailoverConfig|null` |   |

### hasFailoverConfig

### clearFailoverConfig

### setFailoverConfig

Optional. Configuration related to health based failover.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.FailoverConfig` |

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

### getIsolationConfig

Optional. Configuration to provide isolation support for the associated
Backend Service.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.IsolationConfig|null` |   |

### hasIsolationConfig

### clearIsolationConfig

### setIsolationConfig

Optional. Configuration to provide isolation support for the associated
Backend Service.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-networkservices/latest/V1.ServiceLbPolicy.IsolationConfig` |

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