Class BackendService.Builder (1.64.0)

public static final class BackendService.Builder extends GeneratedMessageV3.Builder<BackendService.Builder> implements BackendServiceOrBuilder

Represents a Backend Service resource. A backend service defines how Google Cloud load balancers distribute traffic. The backend service configuration contains a set of values, such as the protocol used to connect to backends, various distribution and session settings, health checks, and timeouts. These settings provide fine-grained control over how your load balancer behaves. Most of the settings have default values that allow for easy configuration if you need to get started quickly. Backend services in Google Compute Engine can be either regionally or globally scoped. * Global * Regional For more information, see Backend Services.

Protobuf type google.cloud.compute.v1.BackendService

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllBackends(Iterable<? extends Backend> values)

public BackendService.Builder addAllBackends(Iterable<? extends Backend> values)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.Backend>
Returns
Type Description
BackendService.Builder

addAllCustomRequestHeaders(Iterable<String> values)

public BackendService.Builder addAllCustomRequestHeaders(Iterable<String> values)

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Parameter
Name Description
values Iterable<String>

The customRequestHeaders to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addAllCustomResponseHeaders(Iterable<String> values)

public BackendService.Builder addAllCustomResponseHeaders(Iterable<String> values)

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Parameter
Name Description
values Iterable<String>

The customResponseHeaders to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addAllHealthChecks(Iterable<String> values)

public BackendService.Builder addAllHealthChecks(Iterable<String> values)

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Parameter
Name Description
values Iterable<String>

The healthChecks to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addAllLocalityLbPolicies(Iterable<? extends BackendServiceLocalityLoadBalancingPolicyConfig> values)

public BackendService.Builder addAllLocalityLbPolicies(Iterable<? extends BackendServiceLocalityLoadBalancingPolicyConfig> values)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig>
Returns
Type Description
BackendService.Builder

addAllServiceBindings(Iterable<String> values)

public BackendService.Builder addAllServiceBindings(Iterable<String> values)

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Parameter
Name Description
values Iterable<String>

The serviceBindings to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addAllUsedBy(Iterable<? extends BackendServiceUsedBy> values)

public BackendService.Builder addAllUsedBy(Iterable<? extends BackendServiceUsedBy> values)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.BackendServiceUsedBy>
Returns
Type Description
BackendService.Builder

addBackends(Backend value)

public BackendService.Builder addBackends(Backend value)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
value Backend
Returns
Type Description
BackendService.Builder

addBackends(Backend.Builder builderForValue)

public BackendService.Builder addBackends(Backend.Builder builderForValue)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
builderForValue Backend.Builder
Returns
Type Description
BackendService.Builder

addBackends(int index, Backend value)

public BackendService.Builder addBackends(int index, Backend value)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameters
Name Description
index int
value Backend
Returns
Type Description
BackendService.Builder

addBackends(int index, Backend.Builder builderForValue)

public BackendService.Builder addBackends(int index, Backend.Builder builderForValue)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameters
Name Description
index int
builderForValue Backend.Builder
Returns
Type Description
BackendService.Builder

addBackendsBuilder()

public Backend.Builder addBackendsBuilder()

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Returns
Type Description
Backend.Builder

addBackendsBuilder(int index)

public Backend.Builder addBackendsBuilder(int index)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
index int
Returns
Type Description
Backend.Builder

addCustomRequestHeaders(String value)

public BackendService.Builder addCustomRequestHeaders(String value)

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Parameter
Name Description
value String

The customRequestHeaders to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addCustomRequestHeadersBytes(ByteString value)

public BackendService.Builder addCustomRequestHeadersBytes(ByteString value)

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Parameter
Name Description
value ByteString

The bytes of the customRequestHeaders to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addCustomResponseHeaders(String value)

public BackendService.Builder addCustomResponseHeaders(String value)

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Parameter
Name Description
value String

The customResponseHeaders to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addCustomResponseHeadersBytes(ByteString value)

public BackendService.Builder addCustomResponseHeadersBytes(ByteString value)

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Parameter
Name Description
value ByteString

The bytes of the customResponseHeaders to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addHealthChecks(String value)

public BackendService.Builder addHealthChecks(String value)

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Parameter
Name Description
value String

The healthChecks to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addHealthChecksBytes(ByteString value)

public BackendService.Builder addHealthChecksBytes(ByteString value)

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Parameter
Name Description
value ByteString

The bytes of the healthChecks to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addLocalityLbPolicies(BackendServiceLocalityLoadBalancingPolicyConfig value)

public BackendService.Builder addLocalityLbPolicies(BackendServiceLocalityLoadBalancingPolicyConfig value)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
value BackendServiceLocalityLoadBalancingPolicyConfig
Returns
Type Description
BackendService.Builder

addLocalityLbPolicies(BackendServiceLocalityLoadBalancingPolicyConfig.Builder builderForValue)

public BackendService.Builder addLocalityLbPolicies(BackendServiceLocalityLoadBalancingPolicyConfig.Builder builderForValue)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
builderForValue BackendServiceLocalityLoadBalancingPolicyConfig.Builder
Returns
Type Description
BackendService.Builder

addLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig value)

public BackendService.Builder addLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig value)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameters
Name Description
index int
value BackendServiceLocalityLoadBalancingPolicyConfig
Returns
Type Description
BackendService.Builder

addLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig.Builder builderForValue)

public BackendService.Builder addLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig.Builder builderForValue)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameters
Name Description
index int
builderForValue BackendServiceLocalityLoadBalancingPolicyConfig.Builder
Returns
Type Description
BackendService.Builder

addLocalityLbPoliciesBuilder()

public BackendServiceLocalityLoadBalancingPolicyConfig.Builder addLocalityLbPoliciesBuilder()

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Returns
Type Description
BackendServiceLocalityLoadBalancingPolicyConfig.Builder

addLocalityLbPoliciesBuilder(int index)

public BackendServiceLocalityLoadBalancingPolicyConfig.Builder addLocalityLbPoliciesBuilder(int index)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceLocalityLoadBalancingPolicyConfig.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public BackendService.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
BackendService.Builder
Overrides

addServiceBindings(String value)

public BackendService.Builder addServiceBindings(String value)

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Parameter
Name Description
value String

The serviceBindings to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addServiceBindingsBytes(ByteString value)

public BackendService.Builder addServiceBindingsBytes(ByteString value)

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Parameter
Name Description
value ByteString

The bytes of the serviceBindings to add.

Returns
Type Description
BackendService.Builder

This builder for chaining.

addUsedBy(BackendServiceUsedBy value)

public BackendService.Builder addUsedBy(BackendServiceUsedBy value)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
value BackendServiceUsedBy
Returns
Type Description
BackendService.Builder

addUsedBy(BackendServiceUsedBy.Builder builderForValue)

public BackendService.Builder addUsedBy(BackendServiceUsedBy.Builder builderForValue)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
builderForValue BackendServiceUsedBy.Builder
Returns
Type Description
BackendService.Builder

addUsedBy(int index, BackendServiceUsedBy value)

public BackendService.Builder addUsedBy(int index, BackendServiceUsedBy value)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameters
Name Description
index int
value BackendServiceUsedBy
Returns
Type Description
BackendService.Builder

addUsedBy(int index, BackendServiceUsedBy.Builder builderForValue)

public BackendService.Builder addUsedBy(int index, BackendServiceUsedBy.Builder builderForValue)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameters
Name Description
index int
builderForValue BackendServiceUsedBy.Builder
Returns
Type Description
BackendService.Builder

addUsedByBuilder()

public BackendServiceUsedBy.Builder addUsedByBuilder()

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Returns
Type Description
BackendServiceUsedBy.Builder

addUsedByBuilder(int index)

public BackendServiceUsedBy.Builder addUsedByBuilder(int index)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceUsedBy.Builder

build()

public BackendService build()
Returns
Type Description
BackendService

buildPartial()

public BackendService buildPartial()
Returns
Type Description
BackendService

clear()

public BackendService.Builder clear()
Returns
Type Description
BackendService.Builder
Overrides

clearAffinityCookieTtlSec()

public BackendService.Builder clearAffinityCookieTtlSec()

Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional int32 affinity_cookie_ttl_sec = 369996954;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearBackends()

public BackendService.Builder clearBackends()

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Returns
Type Description
BackendService.Builder

clearCdnPolicy()

public BackendService.Builder clearCdnPolicy()

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Returns
Type Description
BackendService.Builder

clearCircuitBreakers()

public BackendService.Builder clearCircuitBreakers()

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Returns
Type Description
BackendService.Builder

clearCompressionMode()

public BackendService.Builder clearCompressionMode()

Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. Check the CompressionMode enum for the list of possible values.

optional string compression_mode = 95520988;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearConnectionDraining()

public BackendService.Builder clearConnectionDraining()

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Returns
Type Description
BackendService.Builder

clearConnectionTrackingPolicy()

public BackendService.Builder clearConnectionTrackingPolicy()

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Returns
Type Description
BackendService.Builder

clearConsistentHash()

public BackendService.Builder clearConsistentHash()

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Returns
Type Description
BackendService.Builder

clearCreationTimestamp()

public BackendService.Builder clearCreationTimestamp()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearCustomRequestHeaders()

public BackendService.Builder clearCustomRequestHeaders()

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearCustomResponseHeaders()

public BackendService.Builder clearCustomResponseHeaders()

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearDescription()

public BackendService.Builder clearDescription()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearEdgeSecurityPolicy()

public BackendService.Builder clearEdgeSecurityPolicy()

[Output Only] The resource URL for the edge security policy associated with this backend service.

optional string edge_security_policy = 41036943;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearEnableCDN()

public BackendService.Builder clearEnableCDN()

If true, enables Cloud CDN for the backend service of a global external Application Load Balancer.

optional bool enable_c_d_n = 250733499;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearFailoverPolicy()

public BackendService.Builder clearFailoverPolicy()

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Returns
Type Description
BackendService.Builder

clearField(Descriptors.FieldDescriptor field)

public BackendService.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
BackendService.Builder
Overrides

clearFingerprint()

public BackendService.Builder clearFingerprint()

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService.

optional string fingerprint = 234678500;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearHealthChecks()

public BackendService.Builder clearHealthChecks()

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearIap()

public BackendService.Builder clearIap()

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Returns
Type Description
BackendService.Builder

clearId()

public BackendService.Builder clearId()

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

optional uint64 id = 3355;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearIpAddressSelectionPolicy()

public BackendService.Builder clearIpAddressSelectionPolicy()

Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). Check the IpAddressSelectionPolicy enum for the list of possible values.

optional string ip_address_selection_policy = 77600840;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearKind()

public BackendService.Builder clearKind()

[Output Only] Type of resource. Always compute#backendService for backend services.

optional string kind = 3292052;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearLoadBalancingScheme()

public BackendService.Builder clearLoadBalancingScheme()

Specifies the load balancer type. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. Check the LoadBalancingScheme enum for the list of possible values.

optional string load_balancing_scheme = 363890244;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearLocalityLbPolicies()

public BackendService.Builder clearLocalityLbPolicies()

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Returns
Type Description
BackendService.Builder

clearLocalityLbPolicy()

public BackendService.Builder clearLocalityLbPolicy()

The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Check the LocalityLbPolicy enum for the list of possible values.

optional string locality_lb_policy = 131431487;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearLogConfig()

public BackendService.Builder clearLogConfig()

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Returns
Type Description
BackendService.Builder

clearMaxStreamDuration()

public BackendService.Builder clearMaxStreamDuration()

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Returns
Type Description
BackendService.Builder

clearMetadatas()

public BackendService.Builder clearMetadatas()
Returns
Type Description
BackendService.Builder

clearName()

public BackendService.Builder clearName()

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearNetwork()

public BackendService.Builder clearNetwork()

The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL.

optional string network = 232872494;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public BackendService.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
BackendService.Builder
Overrides

clearOutlierDetection()

public BackendService.Builder clearOutlierDetection()

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Returns
Type Description
BackendService.Builder

clearPort()

public BackendService.Builder clearPort()

Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port.

optional int32 port = 3446913;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearPortName()

public BackendService.Builder clearPortName()

A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name.

optional string port_name = 41534345;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearProtocol()

public BackendService.Builder clearProtocol()

The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. Check the Protocol enum for the list of possible values.

optional string protocol = 84577944;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearRegion()

public BackendService.Builder clearRegion()

[Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

optional string region = 138946292;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearSecurityPolicy()

public BackendService.Builder clearSecurityPolicy()

[Output Only] The resource URL for the security policy associated with this backend service.

optional string security_policy = 171082513;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearSecuritySettings()

public BackendService.Builder clearSecuritySettings()

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Returns
Type Description
BackendService.Builder
public BackendService.Builder clearSelfLink()

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearServiceBindings()

public BackendService.Builder clearServiceBindings()

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearServiceLbPolicy()

public BackendService.Builder clearServiceLbPolicy()

URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.

optional string service_lb_policy = 94848785;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearSessionAffinity()

public BackendService.Builder clearSessionAffinity()

Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: Session Affinity. Check the SessionAffinity enum for the list of possible values.

optional string session_affinity = 463888561;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearStrongSessionAffinityCookie()

public BackendService.Builder clearStrongSessionAffinityCookie()

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Returns
Type Description
BackendService.Builder

clearSubsetting()

public BackendService.Builder clearSubsetting()

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Returns
Type Description
BackendService.Builder

clearTimeoutSec()

public BackendService.Builder clearTimeoutSec()

The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Instead, use maxStreamDuration.

optional int32 timeout_sec = 79994995;

Returns
Type Description
BackendService.Builder

This builder for chaining.

clearUsedBy()

public BackendService.Builder clearUsedBy()

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Returns
Type Description
BackendService.Builder

clone()

public BackendService.Builder clone()
Returns
Type Description
BackendService.Builder
Overrides

containsMetadatas(String key)

public boolean containsMetadatas(String key)

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAffinityCookieTtlSec()

public int getAffinityCookieTtlSec()

Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional int32 affinity_cookie_ttl_sec = 369996954;

Returns
Type Description
int

The affinityCookieTtlSec.

getBackends(int index)

public Backend getBackends(int index)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
index int
Returns
Type Description
Backend

getBackendsBuilder(int index)

public Backend.Builder getBackendsBuilder(int index)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
index int
Returns
Type Description
Backend.Builder

getBackendsBuilderList()

public List<Backend.Builder> getBackendsBuilderList()

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Returns
Type Description
List<Builder>

getBackendsCount()

public int getBackendsCount()

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Returns
Type Description
int

getBackendsList()

public List<Backend> getBackendsList()

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Returns
Type Description
List<Backend>

getBackendsOrBuilder(int index)

public BackendOrBuilder getBackendsOrBuilder(int index)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
index int
Returns
Type Description
BackendOrBuilder

getBackendsOrBuilderList()

public List<? extends BackendOrBuilder> getBackendsOrBuilderList()

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Returns
Type Description
List<? extends com.google.cloud.compute.v1.BackendOrBuilder>

getCdnPolicy()

public BackendServiceCdnPolicy getCdnPolicy()

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Returns
Type Description
BackendServiceCdnPolicy

The cdnPolicy.

getCdnPolicyBuilder()

public BackendServiceCdnPolicy.Builder getCdnPolicyBuilder()

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Returns
Type Description
BackendServiceCdnPolicy.Builder

getCdnPolicyOrBuilder()

public BackendServiceCdnPolicyOrBuilder getCdnPolicyOrBuilder()

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Returns
Type Description
BackendServiceCdnPolicyOrBuilder

getCircuitBreakers()

public CircuitBreakers getCircuitBreakers()

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Returns
Type Description
CircuitBreakers

The circuitBreakers.

getCircuitBreakersBuilder()

public CircuitBreakers.Builder getCircuitBreakersBuilder()

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Returns
Type Description
CircuitBreakers.Builder

getCircuitBreakersOrBuilder()

public CircuitBreakersOrBuilder getCircuitBreakersOrBuilder()

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Returns
Type Description
CircuitBreakersOrBuilder

getCompressionMode()

public String getCompressionMode()

Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. Check the CompressionMode enum for the list of possible values.

optional string compression_mode = 95520988;

Returns
Type Description
String

The compressionMode.

getCompressionModeBytes()

public ByteString getCompressionModeBytes()

Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. Check the CompressionMode enum for the list of possible values.

optional string compression_mode = 95520988;

Returns
Type Description
ByteString

The bytes for compressionMode.

getConnectionDraining()

public ConnectionDraining getConnectionDraining()

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Returns
Type Description
ConnectionDraining

The connectionDraining.

getConnectionDrainingBuilder()

public ConnectionDraining.Builder getConnectionDrainingBuilder()

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Returns
Type Description
ConnectionDraining.Builder

getConnectionDrainingOrBuilder()

public ConnectionDrainingOrBuilder getConnectionDrainingOrBuilder()

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Returns
Type Description
ConnectionDrainingOrBuilder

getConnectionTrackingPolicy()

public BackendServiceConnectionTrackingPolicy getConnectionTrackingPolicy()

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Returns
Type Description
BackendServiceConnectionTrackingPolicy

The connectionTrackingPolicy.

getConnectionTrackingPolicyBuilder()

public BackendServiceConnectionTrackingPolicy.Builder getConnectionTrackingPolicyBuilder()

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Returns
Type Description
BackendServiceConnectionTrackingPolicy.Builder

getConnectionTrackingPolicyOrBuilder()

public BackendServiceConnectionTrackingPolicyOrBuilder getConnectionTrackingPolicyOrBuilder()

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Returns
Type Description
BackendServiceConnectionTrackingPolicyOrBuilder

getConsistentHash()

public ConsistentHashLoadBalancerSettings getConsistentHash()

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Returns
Type Description
ConsistentHashLoadBalancerSettings

The consistentHash.

getConsistentHashBuilder()

public ConsistentHashLoadBalancerSettings.Builder getConsistentHashBuilder()

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Returns
Type Description
ConsistentHashLoadBalancerSettings.Builder

getConsistentHashOrBuilder()

public ConsistentHashLoadBalancerSettingsOrBuilder getConsistentHashOrBuilder()

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Returns
Type Description
ConsistentHashLoadBalancerSettingsOrBuilder

getCreationTimestamp()

public String getCreationTimestamp()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
Type Description
String

The creationTimestamp.

getCreationTimestampBytes()

public ByteString getCreationTimestampBytes()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
Type Description
ByteString

The bytes for creationTimestamp.

getCustomRequestHeaders(int index)

public String getCustomRequestHeaders(int index)

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The customRequestHeaders at the given index.

getCustomRequestHeadersBytes(int index)

public ByteString getCustomRequestHeadersBytes(int index)

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the customRequestHeaders at the given index.

getCustomRequestHeadersCount()

public int getCustomRequestHeadersCount()

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Returns
Type Description
int

The count of customRequestHeaders.

getCustomRequestHeadersList()

public ProtocolStringList getCustomRequestHeadersList()

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Returns
Type Description
ProtocolStringList

A list containing the customRequestHeaders.

getCustomResponseHeaders(int index)

public String getCustomResponseHeaders(int index)

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The customResponseHeaders at the given index.

getCustomResponseHeadersBytes(int index)

public ByteString getCustomResponseHeadersBytes(int index)

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the customResponseHeaders at the given index.

getCustomResponseHeadersCount()

public int getCustomResponseHeadersCount()

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Returns
Type Description
int

The count of customResponseHeaders.

getCustomResponseHeadersList()

public ProtocolStringList getCustomResponseHeadersList()

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Returns
Type Description
ProtocolStringList

A list containing the customResponseHeaders.

getDefaultInstanceForType()

public BackendService getDefaultInstanceForType()
Returns
Type Description
BackendService

getDescription()

public String getDescription()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
Type Description
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEdgeSecurityPolicy()

public String getEdgeSecurityPolicy()

[Output Only] The resource URL for the edge security policy associated with this backend service.

optional string edge_security_policy = 41036943;

Returns
Type Description
String

The edgeSecurityPolicy.

getEdgeSecurityPolicyBytes()

public ByteString getEdgeSecurityPolicyBytes()

[Output Only] The resource URL for the edge security policy associated with this backend service.

optional string edge_security_policy = 41036943;

Returns
Type Description
ByteString

The bytes for edgeSecurityPolicy.

getEnableCDN()

public boolean getEnableCDN()

If true, enables Cloud CDN for the backend service of a global external Application Load Balancer.

optional bool enable_c_d_n = 250733499;

Returns
Type Description
boolean

The enableCDN.

getFailoverPolicy()

public BackendServiceFailoverPolicy getFailoverPolicy()

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Returns
Type Description
BackendServiceFailoverPolicy

The failoverPolicy.

getFailoverPolicyBuilder()

public BackendServiceFailoverPolicy.Builder getFailoverPolicyBuilder()

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Returns
Type Description
BackendServiceFailoverPolicy.Builder

getFailoverPolicyOrBuilder()

public BackendServiceFailoverPolicyOrBuilder getFailoverPolicyOrBuilder()

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Returns
Type Description
BackendServiceFailoverPolicyOrBuilder

getFingerprint()

public String getFingerprint()

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService.

optional string fingerprint = 234678500;

Returns
Type Description
String

The fingerprint.

getFingerprintBytes()

public ByteString getFingerprintBytes()

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService.

optional string fingerprint = 234678500;

Returns
Type Description
ByteString

The bytes for fingerprint.

getHealthChecks(int index)

public String getHealthChecks(int index)

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The healthChecks at the given index.

getHealthChecksBytes(int index)

public ByteString getHealthChecksBytes(int index)

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the healthChecks at the given index.

getHealthChecksCount()

public int getHealthChecksCount()

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Returns
Type Description
int

The count of healthChecks.

getHealthChecksList()

public ProtocolStringList getHealthChecksList()

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Returns
Type Description
ProtocolStringList

A list containing the healthChecks.

getIap()

public BackendServiceIAP getIap()

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Returns
Type Description
BackendServiceIAP

The iap.

getIapBuilder()

public BackendServiceIAP.Builder getIapBuilder()

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Returns
Type Description
BackendServiceIAP.Builder

getIapOrBuilder()

public BackendServiceIAPOrBuilder getIapOrBuilder()

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Returns
Type Description
BackendServiceIAPOrBuilder

getId()

public long getId()

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

optional uint64 id = 3355;

Returns
Type Description
long

The id.

getIpAddressSelectionPolicy()

public String getIpAddressSelectionPolicy()

Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). Check the IpAddressSelectionPolicy enum for the list of possible values.

optional string ip_address_selection_policy = 77600840;

Returns
Type Description
String

The ipAddressSelectionPolicy.

getIpAddressSelectionPolicyBytes()

public ByteString getIpAddressSelectionPolicyBytes()

Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). Check the IpAddressSelectionPolicy enum for the list of possible values.

optional string ip_address_selection_policy = 77600840;

Returns
Type Description
ByteString

The bytes for ipAddressSelectionPolicy.

getKind()

public String getKind()

[Output Only] Type of resource. Always compute#backendService for backend services.

optional string kind = 3292052;

Returns
Type Description
String

The kind.

getKindBytes()

public ByteString getKindBytes()

[Output Only] Type of resource. Always compute#backendService for backend services.

optional string kind = 3292052;

Returns
Type Description
ByteString

The bytes for kind.

getLoadBalancingScheme()

public String getLoadBalancingScheme()

Specifies the load balancer type. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. Check the LoadBalancingScheme enum for the list of possible values.

optional string load_balancing_scheme = 363890244;

Returns
Type Description
String

The loadBalancingScheme.

getLoadBalancingSchemeBytes()

public ByteString getLoadBalancingSchemeBytes()

Specifies the load balancer type. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. Check the LoadBalancingScheme enum for the list of possible values.

optional string load_balancing_scheme = 363890244;

Returns
Type Description
ByteString

The bytes for loadBalancingScheme.

getLocalityLbPolicies(int index)

public BackendServiceLocalityLoadBalancingPolicyConfig getLocalityLbPolicies(int index)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceLocalityLoadBalancingPolicyConfig

getLocalityLbPoliciesBuilder(int index)

public BackendServiceLocalityLoadBalancingPolicyConfig.Builder getLocalityLbPoliciesBuilder(int index)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceLocalityLoadBalancingPolicyConfig.Builder

getLocalityLbPoliciesBuilderList()

public List<BackendServiceLocalityLoadBalancingPolicyConfig.Builder> getLocalityLbPoliciesBuilderList()

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Returns
Type Description
List<Builder>

getLocalityLbPoliciesCount()

public int getLocalityLbPoliciesCount()

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Returns
Type Description
int

getLocalityLbPoliciesList()

public List<BackendServiceLocalityLoadBalancingPolicyConfig> getLocalityLbPoliciesList()

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Returns
Type Description
List<BackendServiceLocalityLoadBalancingPolicyConfig>

getLocalityLbPoliciesOrBuilder(int index)

public BackendServiceLocalityLoadBalancingPolicyConfigOrBuilder getLocalityLbPoliciesOrBuilder(int index)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceLocalityLoadBalancingPolicyConfigOrBuilder

getLocalityLbPoliciesOrBuilderList()

public List<? extends BackendServiceLocalityLoadBalancingPolicyConfigOrBuilder> getLocalityLbPoliciesOrBuilderList()

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Returns
Type Description
List<? extends com.google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigOrBuilder>

getLocalityLbPolicy()

public String getLocalityLbPolicy()

The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Check the LocalityLbPolicy enum for the list of possible values.

optional string locality_lb_policy = 131431487;

Returns
Type Description
String

The localityLbPolicy.

getLocalityLbPolicyBytes()

public ByteString getLocalityLbPolicyBytes()

The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Check the LocalityLbPolicy enum for the list of possible values.

optional string locality_lb_policy = 131431487;

Returns
Type Description
ByteString

The bytes for localityLbPolicy.

getLogConfig()

public BackendServiceLogConfig getLogConfig()

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Returns
Type Description
BackendServiceLogConfig

The logConfig.

getLogConfigBuilder()

public BackendServiceLogConfig.Builder getLogConfigBuilder()

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Returns
Type Description
BackendServiceLogConfig.Builder

getLogConfigOrBuilder()

public BackendServiceLogConfigOrBuilder getLogConfigOrBuilder()

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Returns
Type Description
BackendServiceLogConfigOrBuilder

getMaxStreamDuration()

public Duration getMaxStreamDuration()

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Returns
Type Description
Duration

The maxStreamDuration.

getMaxStreamDurationBuilder()

public Duration.Builder getMaxStreamDurationBuilder()

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Returns
Type Description
Duration.Builder

getMaxStreamDurationOrBuilder()

public DurationOrBuilder getMaxStreamDurationOrBuilder()

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Returns
Type Description
DurationOrBuilder

getMetadatas() (deprecated)

public Map<String,String> getMetadatas()

Use #getMetadatasMap() instead.

Returns
Type Description
Map<String,String>

getMetadatasCount()

public int getMetadatasCount()

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Returns
Type Description
int

getMetadatasMap()

public Map<String,String> getMetadatasMap()

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Returns
Type Description
Map<String,String>

getMetadatasOrDefault(String key, String defaultValue)

public String getMetadatasOrDefault(String key, String defaultValue)

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getMetadatasOrThrow(String key)

public String getMetadatasOrThrow(String key)

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Parameter
Name Description
key String
Returns
Type Description
String

getMutableMetadatas() (deprecated)

public Map<String,String> getMutableMetadatas()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getName()

public String getName()

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
Type Description
ByteString

The bytes for name.

getNetwork()

public String getNetwork()

The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL.

optional string network = 232872494;

Returns
Type Description
String

The network.

getNetworkBytes()

public ByteString getNetworkBytes()

The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL.

optional string network = 232872494;

Returns
Type Description
ByteString

The bytes for network.

getOutlierDetection()

public OutlierDetection getOutlierDetection()

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Returns
Type Description
OutlierDetection

The outlierDetection.

getOutlierDetectionBuilder()

public OutlierDetection.Builder getOutlierDetectionBuilder()

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Returns
Type Description
OutlierDetection.Builder

getOutlierDetectionOrBuilder()

public OutlierDetectionOrBuilder getOutlierDetectionOrBuilder()

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Returns
Type Description
OutlierDetectionOrBuilder

getPort()

public int getPort()

Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port.

optional int32 port = 3446913;

Returns
Type Description
int

The port.

getPortName()

public String getPortName()

A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name.

optional string port_name = 41534345;

Returns
Type Description
String

The portName.

getPortNameBytes()

public ByteString getPortNameBytes()

A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name.

optional string port_name = 41534345;

Returns
Type Description
ByteString

The bytes for portName.

getProtocol()

public String getProtocol()

The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. Check the Protocol enum for the list of possible values.

optional string protocol = 84577944;

Returns
Type Description
String

The protocol.

getProtocolBytes()

public ByteString getProtocolBytes()

The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. Check the Protocol enum for the list of possible values.

optional string protocol = 84577944;

Returns
Type Description
ByteString

The bytes for protocol.

getRegion()

public String getRegion()

[Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

optional string region = 138946292;

Returns
Type Description
String

The region.

getRegionBytes()

public ByteString getRegionBytes()

[Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

optional string region = 138946292;

Returns
Type Description
ByteString

The bytes for region.

getSecurityPolicy()

public String getSecurityPolicy()

[Output Only] The resource URL for the security policy associated with this backend service.

optional string security_policy = 171082513;

Returns
Type Description
String

The securityPolicy.

getSecurityPolicyBytes()

public ByteString getSecurityPolicyBytes()

[Output Only] The resource URL for the security policy associated with this backend service.

optional string security_policy = 171082513;

Returns
Type Description
ByteString

The bytes for securityPolicy.

getSecuritySettings()

public SecuritySettings getSecuritySettings()

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Returns
Type Description
SecuritySettings

The securitySettings.

getSecuritySettingsBuilder()

public SecuritySettings.Builder getSecuritySettingsBuilder()

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Returns
Type Description
SecuritySettings.Builder

getSecuritySettingsOrBuilder()

public SecuritySettingsOrBuilder getSecuritySettingsOrBuilder()

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Returns
Type Description
SecuritySettingsOrBuilder
public String getSelfLink()

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Returns
Type Description
String

The selfLink.

getSelfLinkBytes()

public ByteString getSelfLinkBytes()

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Returns
Type Description
ByteString

The bytes for selfLink.

getServiceBindings(int index)

public String getServiceBindings(int index)

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The serviceBindings at the given index.

getServiceBindingsBytes(int index)

public ByteString getServiceBindingsBytes(int index)

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the serviceBindings at the given index.

getServiceBindingsCount()

public int getServiceBindingsCount()

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Returns
Type Description
int

The count of serviceBindings.

getServiceBindingsList()

public ProtocolStringList getServiceBindingsList()

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Returns
Type Description
ProtocolStringList

A list containing the serviceBindings.

getServiceLbPolicy()

public String getServiceLbPolicy()

URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.

optional string service_lb_policy = 94848785;

Returns
Type Description
String

The serviceLbPolicy.

getServiceLbPolicyBytes()

public ByteString getServiceLbPolicyBytes()

URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.

optional string service_lb_policy = 94848785;

Returns
Type Description
ByteString

The bytes for serviceLbPolicy.

getSessionAffinity()

public String getSessionAffinity()

Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: Session Affinity. Check the SessionAffinity enum for the list of possible values.

optional string session_affinity = 463888561;

Returns
Type Description
String

The sessionAffinity.

getSessionAffinityBytes()

public ByteString getSessionAffinityBytes()

Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: Session Affinity. Check the SessionAffinity enum for the list of possible values.

optional string session_affinity = 463888561;

Returns
Type Description
ByteString

The bytes for sessionAffinity.

getStrongSessionAffinityCookie()

public BackendServiceHttpCookie getStrongSessionAffinityCookie()

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Returns
Type Description
BackendServiceHttpCookie

The strongSessionAffinityCookie.

getStrongSessionAffinityCookieBuilder()

public BackendServiceHttpCookie.Builder getStrongSessionAffinityCookieBuilder()

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Returns
Type Description
BackendServiceHttpCookie.Builder

getStrongSessionAffinityCookieOrBuilder()

public BackendServiceHttpCookieOrBuilder getStrongSessionAffinityCookieOrBuilder()

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Returns
Type Description
BackendServiceHttpCookieOrBuilder

getSubsetting()

public Subsetting getSubsetting()

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Returns
Type Description
Subsetting

The subsetting.

getSubsettingBuilder()

public Subsetting.Builder getSubsettingBuilder()

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Returns
Type Description
Subsetting.Builder

getSubsettingOrBuilder()

public SubsettingOrBuilder getSubsettingOrBuilder()

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Returns
Type Description
SubsettingOrBuilder

getTimeoutSec()

public int getTimeoutSec()

The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Instead, use maxStreamDuration.

optional int32 timeout_sec = 79994995;

Returns
Type Description
int

The timeoutSec.

getUsedBy(int index)

public BackendServiceUsedBy getUsedBy(int index)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceUsedBy

getUsedByBuilder(int index)

public BackendServiceUsedBy.Builder getUsedByBuilder(int index)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceUsedBy.Builder

getUsedByBuilderList()

public List<BackendServiceUsedBy.Builder> getUsedByBuilderList()

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Returns
Type Description
List<Builder>

getUsedByCount()

public int getUsedByCount()

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Returns
Type Description
int

getUsedByList()

public List<BackendServiceUsedBy> getUsedByList()

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Returns
Type Description
List<BackendServiceUsedBy>

getUsedByOrBuilder(int index)

public BackendServiceUsedByOrBuilder getUsedByOrBuilder(int index)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
index int
Returns
Type Description
BackendServiceUsedByOrBuilder

getUsedByOrBuilderList()

public List<? extends BackendServiceUsedByOrBuilder> getUsedByOrBuilderList()

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Returns
Type Description
List<? extends com.google.cloud.compute.v1.BackendServiceUsedByOrBuilder>

hasAffinityCookieTtlSec()

public boolean hasAffinityCookieTtlSec()

Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional int32 affinity_cookie_ttl_sec = 369996954;

Returns
Type Description
boolean

Whether the affinityCookieTtlSec field is set.

hasCdnPolicy()

public boolean hasCdnPolicy()

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Returns
Type Description
boolean

Whether the cdnPolicy field is set.

hasCircuitBreakers()

public boolean hasCircuitBreakers()

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Returns
Type Description
boolean

Whether the circuitBreakers field is set.

hasCompressionMode()

public boolean hasCompressionMode()

Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. Check the CompressionMode enum for the list of possible values.

optional string compression_mode = 95520988;

Returns
Type Description
boolean

Whether the compressionMode field is set.

hasConnectionDraining()

public boolean hasConnectionDraining()

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Returns
Type Description
boolean

Whether the connectionDraining field is set.

hasConnectionTrackingPolicy()

public boolean hasConnectionTrackingPolicy()

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Returns
Type Description
boolean

Whether the connectionTrackingPolicy field is set.

hasConsistentHash()

public boolean hasConsistentHash()

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Returns
Type Description
boolean

Whether the consistentHash field is set.

hasCreationTimestamp()

public boolean hasCreationTimestamp()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
Type Description
boolean

Whether the creationTimestamp field is set.

hasDescription()

public boolean hasDescription()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
Type Description
boolean

Whether the description field is set.

hasEdgeSecurityPolicy()

public boolean hasEdgeSecurityPolicy()

[Output Only] The resource URL for the edge security policy associated with this backend service.

optional string edge_security_policy = 41036943;

Returns
Type Description
boolean

Whether the edgeSecurityPolicy field is set.

hasEnableCDN()

public boolean hasEnableCDN()

If true, enables Cloud CDN for the backend service of a global external Application Load Balancer.

optional bool enable_c_d_n = 250733499;

Returns
Type Description
boolean

Whether the enableCDN field is set.

hasFailoverPolicy()

public boolean hasFailoverPolicy()

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Returns
Type Description
boolean

Whether the failoverPolicy field is set.

hasFingerprint()

public boolean hasFingerprint()

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService.

optional string fingerprint = 234678500;

Returns
Type Description
boolean

Whether the fingerprint field is set.

hasIap()

public boolean hasIap()

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Returns
Type Description
boolean

Whether the iap field is set.

hasId()

public boolean hasId()

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

optional uint64 id = 3355;

Returns
Type Description
boolean

Whether the id field is set.

hasIpAddressSelectionPolicy()

public boolean hasIpAddressSelectionPolicy()

Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). Check the IpAddressSelectionPolicy enum for the list of possible values.

optional string ip_address_selection_policy = 77600840;

Returns
Type Description
boolean

Whether the ipAddressSelectionPolicy field is set.

hasKind()

public boolean hasKind()

[Output Only] Type of resource. Always compute#backendService for backend services.

optional string kind = 3292052;

Returns
Type Description
boolean

Whether the kind field is set.

hasLoadBalancingScheme()

public boolean hasLoadBalancingScheme()

Specifies the load balancer type. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. Check the LoadBalancingScheme enum for the list of possible values.

optional string load_balancing_scheme = 363890244;

Returns
Type Description
boolean

Whether the loadBalancingScheme field is set.

hasLocalityLbPolicy()

public boolean hasLocalityLbPolicy()

The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Check the LocalityLbPolicy enum for the list of possible values.

optional string locality_lb_policy = 131431487;

Returns
Type Description
boolean

Whether the localityLbPolicy field is set.

hasLogConfig()

public boolean hasLogConfig()

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Returns
Type Description
boolean

Whether the logConfig field is set.

hasMaxStreamDuration()

public boolean hasMaxStreamDuration()

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Returns
Type Description
boolean

Whether the maxStreamDuration field is set.

hasName()

public boolean hasName()

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
Type Description
boolean

Whether the name field is set.

hasNetwork()

public boolean hasNetwork()

The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL.

optional string network = 232872494;

Returns
Type Description
boolean

Whether the network field is set.

hasOutlierDetection()

public boolean hasOutlierDetection()

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Returns
Type Description
boolean

Whether the outlierDetection field is set.

hasPort()

public boolean hasPort()

Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port.

optional int32 port = 3446913;

Returns
Type Description
boolean

Whether the port field is set.

hasPortName()

public boolean hasPortName()

A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name.

optional string port_name = 41534345;

Returns
Type Description
boolean

Whether the portName field is set.

hasProtocol()

public boolean hasProtocol()

The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. Check the Protocol enum for the list of possible values.

optional string protocol = 84577944;

Returns
Type Description
boolean

Whether the protocol field is set.

hasRegion()

public boolean hasRegion()

[Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

optional string region = 138946292;

Returns
Type Description
boolean

Whether the region field is set.

hasSecurityPolicy()

public boolean hasSecurityPolicy()

[Output Only] The resource URL for the security policy associated with this backend service.

optional string security_policy = 171082513;

Returns
Type Description
boolean

Whether the securityPolicy field is set.

hasSecuritySettings()

public boolean hasSecuritySettings()

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Returns
Type Description
boolean

Whether the securitySettings field is set.

public boolean hasSelfLink()

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Returns
Type Description
boolean

Whether the selfLink field is set.

hasServiceLbPolicy()

public boolean hasServiceLbPolicy()

URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.

optional string service_lb_policy = 94848785;

Returns
Type Description
boolean

Whether the serviceLbPolicy field is set.

hasSessionAffinity()

public boolean hasSessionAffinity()

Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: Session Affinity. Check the SessionAffinity enum for the list of possible values.

optional string session_affinity = 463888561;

Returns
Type Description
boolean

Whether the sessionAffinity field is set.

hasStrongSessionAffinityCookie()

public boolean hasStrongSessionAffinityCookie()

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Returns
Type Description
boolean

Whether the strongSessionAffinityCookie field is set.

hasSubsetting()

public boolean hasSubsetting()

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Returns
Type Description
boolean

Whether the subsetting field is set.

hasTimeoutSec()

public boolean hasTimeoutSec()

The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Instead, use maxStreamDuration.

optional int32 timeout_sec = 79994995;

Returns
Type Description
boolean

Whether the timeoutSec field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCdnPolicy(BackendServiceCdnPolicy value)

public BackendService.Builder mergeCdnPolicy(BackendServiceCdnPolicy value)

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Parameter
Name Description
value BackendServiceCdnPolicy
Returns
Type Description
BackendService.Builder

mergeCircuitBreakers(CircuitBreakers value)

public BackendService.Builder mergeCircuitBreakers(CircuitBreakers value)

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Parameter
Name Description
value CircuitBreakers
Returns
Type Description
BackendService.Builder

mergeConnectionDraining(ConnectionDraining value)

public BackendService.Builder mergeConnectionDraining(ConnectionDraining value)

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Parameter
Name Description
value ConnectionDraining
Returns
Type Description
BackendService.Builder

mergeConnectionTrackingPolicy(BackendServiceConnectionTrackingPolicy value)

public BackendService.Builder mergeConnectionTrackingPolicy(BackendServiceConnectionTrackingPolicy value)

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Parameter
Name Description
value BackendServiceConnectionTrackingPolicy
Returns
Type Description
BackendService.Builder

mergeConsistentHash(ConsistentHashLoadBalancerSettings value)

public BackendService.Builder mergeConsistentHash(ConsistentHashLoadBalancerSettings value)

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Parameter
Name Description
value ConsistentHashLoadBalancerSettings
Returns
Type Description
BackendService.Builder

mergeFailoverPolicy(BackendServiceFailoverPolicy value)

public BackendService.Builder mergeFailoverPolicy(BackendServiceFailoverPolicy value)

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Parameter
Name Description
value BackendServiceFailoverPolicy
Returns
Type Description
BackendService.Builder

mergeFrom(BackendService other)

public BackendService.Builder mergeFrom(BackendService other)
Parameter
Name Description
other BackendService
Returns
Type Description
BackendService.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public BackendService.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BackendService.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public BackendService.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
BackendService.Builder
Overrides

mergeIap(BackendServiceIAP value)

public BackendService.Builder mergeIap(BackendServiceIAP value)

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Parameter
Name Description
value BackendServiceIAP
Returns
Type Description
BackendService.Builder

mergeLogConfig(BackendServiceLogConfig value)

public BackendService.Builder mergeLogConfig(BackendServiceLogConfig value)

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Parameter
Name Description
value BackendServiceLogConfig
Returns
Type Description
BackendService.Builder

mergeMaxStreamDuration(Duration value)

public BackendService.Builder mergeMaxStreamDuration(Duration value)

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Parameter
Name Description
value Duration
Returns
Type Description
BackendService.Builder

mergeOutlierDetection(OutlierDetection value)

public BackendService.Builder mergeOutlierDetection(OutlierDetection value)

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Parameter
Name Description
value OutlierDetection
Returns
Type Description
BackendService.Builder

mergeSecuritySettings(SecuritySettings value)

public BackendService.Builder mergeSecuritySettings(SecuritySettings value)

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Parameter
Name Description
value SecuritySettings
Returns
Type Description
BackendService.Builder

mergeStrongSessionAffinityCookie(BackendServiceHttpCookie value)

public BackendService.Builder mergeStrongSessionAffinityCookie(BackendServiceHttpCookie value)

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Parameter
Name Description
value BackendServiceHttpCookie
Returns
Type Description
BackendService.Builder

mergeSubsetting(Subsetting value)

public BackendService.Builder mergeSubsetting(Subsetting value)

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Parameter
Name Description
value Subsetting
Returns
Type Description
BackendService.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final BackendService.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
BackendService.Builder
Overrides

putAllMetadatas(Map<String,String> values)

public BackendService.Builder putAllMetadatas(Map<String,String> values)

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
BackendService.Builder

putMetadatas(String key, String value)

public BackendService.Builder putMetadatas(String key, String value)

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Parameters
Name Description
key String
value String
Returns
Type Description
BackendService.Builder

removeBackends(int index)

public BackendService.Builder removeBackends(int index)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameter
Name Description
index int
Returns
Type Description
BackendService.Builder

removeLocalityLbPolicies(int index)

public BackendService.Builder removeLocalityLbPolicies(int index)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameter
Name Description
index int
Returns
Type Description
BackendService.Builder

removeMetadatas(String key)

public BackendService.Builder removeMetadatas(String key)

Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH

map<string, string> metadatas = 8514340;

Parameter
Name Description
key String
Returns
Type Description
BackendService.Builder

removeUsedBy(int index)

public BackendService.Builder removeUsedBy(int index)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameter
Name Description
index int
Returns
Type Description
BackendService.Builder

setAffinityCookieTtlSec(int value)

public BackendService.Builder setAffinityCookieTtlSec(int value)

Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional int32 affinity_cookie_ttl_sec = 369996954;

Parameter
Name Description
value int

The affinityCookieTtlSec to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setBackends(int index, Backend value)

public BackendService.Builder setBackends(int index, Backend value)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameters
Name Description
index int
value Backend
Returns
Type Description
BackendService.Builder

setBackends(int index, Backend.Builder builderForValue)

public BackendService.Builder setBackends(int index, Backend.Builder builderForValue)

The list of backends that serve this BackendService.

repeated .google.cloud.compute.v1.Backend backends = 510839903;

Parameters
Name Description
index int
builderForValue Backend.Builder
Returns
Type Description
BackendService.Builder

setCdnPolicy(BackendServiceCdnPolicy value)

public BackendService.Builder setCdnPolicy(BackendServiceCdnPolicy value)

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Parameter
Name Description
value BackendServiceCdnPolicy
Returns
Type Description
BackendService.Builder

setCdnPolicy(BackendServiceCdnPolicy.Builder builderForValue)

public BackendService.Builder setCdnPolicy(BackendServiceCdnPolicy.Builder builderForValue)

Cloud CDN configuration for this BackendService. Only available for specified load balancer types.

optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452;

Parameter
Name Description
builderForValue BackendServiceCdnPolicy.Builder
Returns
Type Description
BackendService.Builder

setCircuitBreakers(CircuitBreakers value)

public BackendService.Builder setCircuitBreakers(CircuitBreakers value)

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Parameter
Name Description
value CircuitBreakers
Returns
Type Description
BackendService.Builder

setCircuitBreakers(CircuitBreakers.Builder builderForValue)

public BackendService.Builder setCircuitBreakers(CircuitBreakers.Builder builderForValue)

optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061;

Parameter
Name Description
builderForValue CircuitBreakers.Builder
Returns
Type Description
BackendService.Builder

setCompressionMode(String value)

public BackendService.Builder setCompressionMode(String value)

Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. Check the CompressionMode enum for the list of possible values.

optional string compression_mode = 95520988;

Parameter
Name Description
value String

The compressionMode to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setCompressionModeBytes(ByteString value)

public BackendService.Builder setCompressionModeBytes(ByteString value)

Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. Check the CompressionMode enum for the list of possible values.

optional string compression_mode = 95520988;

Parameter
Name Description
value ByteString

The bytes for compressionMode to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setConnectionDraining(ConnectionDraining value)

public BackendService.Builder setConnectionDraining(ConnectionDraining value)

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Parameter
Name Description
value ConnectionDraining
Returns
Type Description
BackendService.Builder

setConnectionDraining(ConnectionDraining.Builder builderForValue)

public BackendService.Builder setConnectionDraining(ConnectionDraining.Builder builderForValue)

optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747;

Parameter
Name Description
builderForValue ConnectionDraining.Builder
Returns
Type Description
BackendService.Builder

setConnectionTrackingPolicy(BackendServiceConnectionTrackingPolicy value)

public BackendService.Builder setConnectionTrackingPolicy(BackendServiceConnectionTrackingPolicy value)

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Parameter
Name Description
value BackendServiceConnectionTrackingPolicy
Returns
Type Description
BackendService.Builder

setConnectionTrackingPolicy(BackendServiceConnectionTrackingPolicy.Builder builderForValue)

public BackendService.Builder setConnectionTrackingPolicy(BackendServiceConnectionTrackingPolicy.Builder builderForValue)

Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969;

Parameter
Name Description
builderForValue BackendServiceConnectionTrackingPolicy.Builder
Returns
Type Description
BackendService.Builder

setConsistentHash(ConsistentHashLoadBalancerSettings value)

public BackendService.Builder setConsistentHash(ConsistentHashLoadBalancerSettings value)

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Parameter
Name Description
value ConsistentHashLoadBalancerSettings
Returns
Type Description
BackendService.Builder

setConsistentHash(ConsistentHashLoadBalancerSettings.Builder builderForValue)

public BackendService.Builder setConsistentHash(ConsistentHashLoadBalancerSettings.Builder builderForValue)

Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883;

Parameter
Name Description
builderForValue ConsistentHashLoadBalancerSettings.Builder
Returns
Type Description
BackendService.Builder

setCreationTimestamp(String value)

public BackendService.Builder setCreationTimestamp(String value)

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Parameter
Name Description
value String

The creationTimestamp to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setCreationTimestampBytes(ByteString value)

public BackendService.Builder setCreationTimestampBytes(ByteString value)

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Parameter
Name Description
value ByteString

The bytes for creationTimestamp to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setCustomRequestHeaders(int index, String value)

public BackendService.Builder setCustomRequestHeaders(int index, String value)

Headers that the load balancer adds to proxied requests. See Creating custom headers.

repeated string custom_request_headers = 27977992;

Parameters
Name Description
index int

The index to set the value at.

value String

The customRequestHeaders to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setCustomResponseHeaders(int index, String value)

public BackendService.Builder setCustomResponseHeaders(int index, String value)

Headers that the load balancer adds to proxied responses. See Creating custom headers.

repeated string custom_response_headers = 387539094;

Parameters
Name Description
index int

The index to set the value at.

value String

The customResponseHeaders to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setDescription(String value)

public BackendService.Builder setDescription(String value)

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Parameter
Name Description
value String

The description to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public BackendService.Builder setDescriptionBytes(ByteString value)

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Parameter
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setEdgeSecurityPolicy(String value)

public BackendService.Builder setEdgeSecurityPolicy(String value)

[Output Only] The resource URL for the edge security policy associated with this backend service.

optional string edge_security_policy = 41036943;

Parameter
Name Description
value String

The edgeSecurityPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setEdgeSecurityPolicyBytes(ByteString value)

public BackendService.Builder setEdgeSecurityPolicyBytes(ByteString value)

[Output Only] The resource URL for the edge security policy associated with this backend service.

optional string edge_security_policy = 41036943;

Parameter
Name Description
value ByteString

The bytes for edgeSecurityPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setEnableCDN(boolean value)

public BackendService.Builder setEnableCDN(boolean value)

If true, enables Cloud CDN for the backend service of a global external Application Load Balancer.

optional bool enable_c_d_n = 250733499;

Parameter
Name Description
value boolean

The enableCDN to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setFailoverPolicy(BackendServiceFailoverPolicy value)

public BackendService.Builder setFailoverPolicy(BackendServiceFailoverPolicy value)

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Parameter
Name Description
value BackendServiceFailoverPolicy
Returns
Type Description
BackendService.Builder

setFailoverPolicy(BackendServiceFailoverPolicy.Builder builderForValue)

public BackendService.Builder setFailoverPolicy(BackendServiceFailoverPolicy.Builder builderForValue)

Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655;

Parameter
Name Description
builderForValue BackendServiceFailoverPolicy.Builder
Returns
Type Description
BackendService.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public BackendService.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
BackendService.Builder
Overrides

setFingerprint(String value)

public BackendService.Builder setFingerprint(String value)

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService.

optional string fingerprint = 234678500;

Parameter
Name Description
value String

The fingerprint to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setFingerprintBytes(ByteString value)

public BackendService.Builder setFingerprintBytes(ByteString value)

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService.

optional string fingerprint = 234678500;

Parameter
Name Description
value ByteString

The bytes for fingerprint to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setHealthChecks(int index, String value)

public BackendService.Builder setHealthChecks(int index, String value)

The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check.

repeated string health_checks = 448370606;

Parameters
Name Description
index int

The index to set the value at.

value String

The healthChecks to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setIap(BackendServiceIAP value)

public BackendService.Builder setIap(BackendServiceIAP value)

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Parameter
Name Description
value BackendServiceIAP
Returns
Type Description
BackendService.Builder

setIap(BackendServiceIAP.Builder builderForValue)

public BackendService.Builder setIap(BackendServiceIAP.Builder builderForValue)

The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers.

optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024;

Parameter
Name Description
builderForValue BackendServiceIAP.Builder
Returns
Type Description
BackendService.Builder

setId(long value)

public BackendService.Builder setId(long value)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

optional uint64 id = 3355;

Parameter
Name Description
value long

The id to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setIpAddressSelectionPolicy(String value)

public BackendService.Builder setIpAddressSelectionPolicy(String value)

Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). Check the IpAddressSelectionPolicy enum for the list of possible values.

optional string ip_address_selection_policy = 77600840;

Parameter
Name Description
value String

The ipAddressSelectionPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setIpAddressSelectionPolicyBytes(ByteString value)

public BackendService.Builder setIpAddressSelectionPolicyBytes(ByteString value)

Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). Check the IpAddressSelectionPolicy enum for the list of possible values.

optional string ip_address_selection_policy = 77600840;

Parameter
Name Description
value ByteString

The bytes for ipAddressSelectionPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setKind(String value)

public BackendService.Builder setKind(String value)

[Output Only] Type of resource. Always compute#backendService for backend services.

optional string kind = 3292052;

Parameter
Name Description
value String

The kind to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setKindBytes(ByteString value)

public BackendService.Builder setKindBytes(ByteString value)

[Output Only] Type of resource. Always compute#backendService for backend services.

optional string kind = 3292052;

Parameter
Name Description
value ByteString

The bytes for kind to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setLoadBalancingScheme(String value)

public BackendService.Builder setLoadBalancingScheme(String value)

Specifies the load balancer type. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. Check the LoadBalancingScheme enum for the list of possible values.

optional string load_balancing_scheme = 363890244;

Parameter
Name Description
value String

The loadBalancingScheme to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setLoadBalancingSchemeBytes(ByteString value)

public BackendService.Builder setLoadBalancingSchemeBytes(ByteString value)

Specifies the load balancer type. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. Check the LoadBalancingScheme enum for the list of possible values.

optional string load_balancing_scheme = 363890244;

Parameter
Name Description
value ByteString

The bytes for loadBalancingScheme to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig value)

public BackendService.Builder setLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig value)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameters
Name Description
index int
value BackendServiceLocalityLoadBalancingPolicyConfig
Returns
Type Description
BackendService.Builder

setLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig.Builder builderForValue)

public BackendService.Builder setLocalityLbPolicies(int index, BackendServiceLocalityLoadBalancingPolicyConfig.Builder builderForValue)

A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration.

repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557;

Parameters
Name Description
index int
builderForValue BackendServiceLocalityLoadBalancingPolicyConfig.Builder
Returns
Type Description
BackendService.Builder

setLocalityLbPolicy(String value)

public BackendService.Builder setLocalityLbPolicy(String value)

The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Check the LocalityLbPolicy enum for the list of possible values.

optional string locality_lb_policy = 131431487;

Parameter
Name Description
value String

The localityLbPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setLocalityLbPolicyBytes(ByteString value)

public BackendService.Builder setLocalityLbPolicyBytes(ByteString value)

The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Check the LocalityLbPolicy enum for the list of possible values.

optional string locality_lb_policy = 131431487;

Parameter
Name Description
value ByteString

The bytes for localityLbPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setLogConfig(BackendServiceLogConfig value)

public BackendService.Builder setLogConfig(BackendServiceLogConfig value)

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Parameter
Name Description
value BackendServiceLogConfig
Returns
Type Description
BackendService.Builder

setLogConfig(BackendServiceLogConfig.Builder builderForValue)

public BackendService.Builder setLogConfig(BackendServiceLogConfig.Builder builderForValue)

This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver.

optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741;

Parameter
Name Description
builderForValue BackendServiceLogConfig.Builder
Returns
Type Description
BackendService.Builder

setMaxStreamDuration(Duration value)

public BackendService.Builder setMaxStreamDuration(Duration value)

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Parameter
Name Description
value Duration
Returns
Type Description
BackendService.Builder

setMaxStreamDuration(Duration.Builder builderForValue)

public BackendService.Builder setMaxStreamDuration(Duration.Builder builderForValue)

Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376;

Parameter
Name Description
builderForValue Duration.Builder
Returns
Type Description
BackendService.Builder

setName(String value)

public BackendService.Builder setName(String value)

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setNameBytes(ByteString value)

public BackendService.Builder setNameBytes(ByteString value)

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setNetwork(String value)

public BackendService.Builder setNetwork(String value)

The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL.

optional string network = 232872494;

Parameter
Name Description
value String

The network to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setNetworkBytes(ByteString value)

public BackendService.Builder setNetworkBytes(ByteString value)

The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL.

optional string network = 232872494;

Parameter
Name Description
value ByteString

The bytes for network to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setOutlierDetection(OutlierDetection value)

public BackendService.Builder setOutlierDetection(OutlierDetection value)

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Parameter
Name Description
value OutlierDetection
Returns
Type Description
BackendService.Builder

setOutlierDetection(OutlierDetection.Builder builderForValue)

public BackendService.Builder setOutlierDetection(OutlierDetection.Builder builderForValue)

Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086;

Parameter
Name Description
builderForValue OutlierDetection.Builder
Returns
Type Description
BackendService.Builder

setPort(int value)

public BackendService.Builder setPort(int value)

Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port.

optional int32 port = 3446913;

Parameter
Name Description
value int

The port to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setPortName(String value)

public BackendService.Builder setPortName(String value)

A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name.

optional string port_name = 41534345;

Parameter
Name Description
value String

The portName to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setPortNameBytes(ByteString value)

public BackendService.Builder setPortNameBytes(ByteString value)

A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name.

optional string port_name = 41534345;

Parameter
Name Description
value ByteString

The bytes for portName to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setProtocol(String value)

public BackendService.Builder setProtocol(String value)

The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. Check the Protocol enum for the list of possible values.

optional string protocol = 84577944;

Parameter
Name Description
value String

The protocol to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setProtocolBytes(ByteString value)

public BackendService.Builder setProtocolBytes(ByteString value)

The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. Check the Protocol enum for the list of possible values.

optional string protocol = 84577944;

Parameter
Name Description
value ByteString

The bytes for protocol to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setRegion(String value)

public BackendService.Builder setRegion(String value)

[Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

optional string region = 138946292;

Parameter
Name Description
value String

The region to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setRegionBytes(ByteString value)

public BackendService.Builder setRegionBytes(ByteString value)

[Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

optional string region = 138946292;

Parameter
Name Description
value ByteString

The bytes for region to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public BackendService.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
BackendService.Builder
Overrides

setSecurityPolicy(String value)

public BackendService.Builder setSecurityPolicy(String value)

[Output Only] The resource URL for the security policy associated with this backend service.

optional string security_policy = 171082513;

Parameter
Name Description
value String

The securityPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setSecurityPolicyBytes(ByteString value)

public BackendService.Builder setSecurityPolicyBytes(ByteString value)

[Output Only] The resource URL for the security policy associated with this backend service.

optional string security_policy = 171082513;

Parameter
Name Description
value ByteString

The bytes for securityPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setSecuritySettings(SecuritySettings value)

public BackendService.Builder setSecuritySettings(SecuritySettings value)

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Parameter
Name Description
value SecuritySettings
Returns
Type Description
BackendService.Builder

setSecuritySettings(SecuritySettings.Builder builderForValue)

public BackendService.Builder setSecuritySettings(SecuritySettings.Builder builderForValue)

This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.

optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922;

Parameter
Name Description
builderForValue SecuritySettings.Builder
Returns
Type Description
BackendService.Builder
public BackendService.Builder setSelfLink(String value)

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Parameter
Name Description
value String

The selfLink to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setSelfLinkBytes(ByteString value)

public BackendService.Builder setSelfLinkBytes(ByteString value)

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Parameter
Name Description
value ByteString

The bytes for selfLink to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setServiceBindings(int index, String value)

public BackendService.Builder setServiceBindings(int index, String value)

URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.

repeated string service_bindings = 133581016;

Parameters
Name Description
index int

The index to set the value at.

value String

The serviceBindings to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setServiceLbPolicy(String value)

public BackendService.Builder setServiceLbPolicy(String value)

URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.

optional string service_lb_policy = 94848785;

Parameter
Name Description
value String

The serviceLbPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setServiceLbPolicyBytes(ByteString value)

public BackendService.Builder setServiceLbPolicyBytes(ByteString value)

URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.

optional string service_lb_policy = 94848785;

Parameter
Name Description
value ByteString

The bytes for serviceLbPolicy to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setSessionAffinity(String value)

public BackendService.Builder setSessionAffinity(String value)

Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: Session Affinity. Check the SessionAffinity enum for the list of possible values.

optional string session_affinity = 463888561;

Parameter
Name Description
value String

The sessionAffinity to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setSessionAffinityBytes(ByteString value)

public BackendService.Builder setSessionAffinityBytes(ByteString value)

Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: Session Affinity. Check the SessionAffinity enum for the list of possible values.

optional string session_affinity = 463888561;

Parameter
Name Description
value ByteString

The bytes for sessionAffinity to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setStrongSessionAffinityCookie(BackendServiceHttpCookie value)

public BackendService.Builder setStrongSessionAffinityCookie(BackendServiceHttpCookie value)

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Parameter
Name Description
value BackendServiceHttpCookie
Returns
Type Description
BackendService.Builder

setStrongSessionAffinityCookie(BackendServiceHttpCookie.Builder builderForValue)

public BackendService.Builder setStrongSessionAffinityCookie(BackendServiceHttpCookie.Builder builderForValue)

Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY.

optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722;

Parameter
Name Description
builderForValue BackendServiceHttpCookie.Builder
Returns
Type Description
BackendService.Builder

setSubsetting(Subsetting value)

public BackendService.Builder setSubsetting(Subsetting value)

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Parameter
Name Description
value Subsetting
Returns
Type Description
BackendService.Builder

setSubsetting(Subsetting.Builder builderForValue)

public BackendService.Builder setSubsetting(Subsetting.Builder builderForValue)

optional .google.cloud.compute.v1.Subsetting subsetting = 450283536;

Parameter
Name Description
builderForValue Subsetting.Builder
Returns
Type Description
BackendService.Builder

setTimeoutSec(int value)

public BackendService.Builder setTimeoutSec(int value)

The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. Instead, use maxStreamDuration.

optional int32 timeout_sec = 79994995;

Parameter
Name Description
value int

The timeoutSec to set.

Returns
Type Description
BackendService.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final BackendService.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
BackendService.Builder
Overrides

setUsedBy(int index, BackendServiceUsedBy value)

public BackendService.Builder setUsedBy(int index, BackendServiceUsedBy value)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameters
Name Description
index int
value BackendServiceUsedBy
Returns
Type Description
BackendService.Builder

setUsedBy(int index, BackendServiceUsedBy.Builder builderForValue)

public BackendService.Builder setUsedBy(int index, BackendServiceUsedBy.Builder builderForValue)

[Output Only] List of resources referencing given backend service.

repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729;

Parameters
Name Description
index int
builderForValue BackendServiceUsedBy.Builder
Returns
Type Description
BackendService.Builder