Class WeightedBackendService (1.6.0-beta)

public final class WeightedBackendService extends GeneratedMessageV3 implements WeightedBackendServiceOrBuilder

In contrast to a single BackendService in HttpRouteAction to which all matching traffic is directed to, WeightedBackendService allows traffic to be split across multiple BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService

Protobuf type google.cloud.compute.v1.WeightedBackendService

Fields

BACKEND_SERVICE_FIELD_NUMBER

public static final int BACKEND_SERVICE_FIELD_NUMBER
Field Value
TypeDescription
int

HEADER_ACTION_FIELD_NUMBER

public static final int HEADER_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

WEIGHT_FIELD_NUMBER

public static final int WEIGHT_FIELD_NUMBER
Field Value
TypeDescription
int

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getBackendService()

public String getBackendService()

The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight.

optional string backend_service = 306946058;

Returns
TypeDescription
String

The backendService.

getBackendServiceBytes()

public ByteString getBackendServiceBytes()

The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight.

optional string backend_service = 306946058;

Returns
TypeDescription
ByteString

The bytes for backendService.

getDefaultInstance()

public static WeightedBackendService getDefaultInstance()
Returns
TypeDescription
WeightedBackendService

getDefaultInstanceForType()

public WeightedBackendService getDefaultInstanceForType()
Returns
TypeDescription
WeightedBackendService

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

getHeaderAction()

public HttpHeaderAction getHeaderAction()

Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;

Returns
TypeDescription
HttpHeaderAction

The headerAction.

getHeaderActionOrBuilder()

public HttpHeaderActionOrBuilder getHeaderActionOrBuilder()

Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;

Returns
TypeDescription
HttpHeaderActionOrBuilder

getParserForType()

public Parser<WeightedBackendService> getParserForType()
Returns
TypeDescription
Parser<WeightedBackendService>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

getWeight()

public int getWeight()

Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. The value must be between 0 and 1000

optional uint32 weight = 282149496;

Returns
TypeDescription
int

The weight.

hasBackendService()

public boolean hasBackendService()

The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight.

optional string backend_service = 306946058;

Returns
TypeDescription
boolean

Whether the backendService field is set.

hasHeaderAction()

public boolean hasHeaderAction()

Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true.

optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;

Returns
TypeDescription
boolean

Whether the headerAction field is set.

hasWeight()

public boolean hasWeight()

Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. The value must be between 0 and 1000

optional uint32 weight = 282149496;

Returns
TypeDescription
boolean

Whether the weight field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilder()

public static WeightedBackendService.Builder newBuilder()
Returns
TypeDescription
WeightedBackendService.Builder

newBuilder(WeightedBackendService prototype)

public static WeightedBackendService.Builder newBuilder(WeightedBackendService prototype)
Parameter
NameDescription
prototypeWeightedBackendService
Returns
TypeDescription
WeightedBackendService.Builder

newBuilderForType()

public WeightedBackendService.Builder newBuilderForType()
Returns
TypeDescription
WeightedBackendService.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected WeightedBackendService.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
WeightedBackendService.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

parseDelimitedFrom(InputStream input)

public static WeightedBackendService parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WeightedBackendService parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static WeightedBackendService parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static WeightedBackendService parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static WeightedBackendService parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static WeightedBackendService parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static WeightedBackendService parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static WeightedBackendService parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static WeightedBackendService parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WeightedBackendService parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static WeightedBackendService parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static WeightedBackendService parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WeightedBackendService
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<WeightedBackendService> parser()
Returns
TypeDescription
Parser<WeightedBackendService>

toBuilder()

public WeightedBackendService.Builder toBuilder()
Returns
TypeDescription
WeightedBackendService.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException