Class PathRule.Builder (1.50.0)

public static final class PathRule.Builder extends GeneratedMessageV3.Builder<PathRule.Builder> implements PathRuleOrBuilder

A path-matching rule for a URL. If matched, will use the specified BackendService to handle the traffic arriving at this URL.

Protobuf type google.cloud.compute.v1.PathRule

Implements

PathRuleOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllPaths(Iterable<String> values)

public PathRule.Builder addAllPaths(Iterable<String> values)

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Parameter
NameDescription
valuesIterable<String>

The paths to add.

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

addPaths(String value)

public PathRule.Builder addPaths(String value)

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Parameter
NameDescription
valueString

The paths to add.

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

addPathsBytes(ByteString value)

public PathRule.Builder addPathsBytes(ByteString value)

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Parameter
NameDescription
valueByteString

The bytes of the paths to add.

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PathRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PathRule.Builder
Overrides

build()

public PathRule build()
Returns
TypeDescription
PathRule

buildPartial()

public PathRule buildPartial()
Returns
TypeDescription
PathRule

clear()

public PathRule.Builder clear()
Returns
TypeDescription
PathRule.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public PathRule.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PathRule.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public PathRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
PathRule.Builder
Overrides

clearPaths()

public PathRule.Builder clearPaths()

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

clearRouteAction()

public PathRule.Builder clearRouteAction()

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Returns
TypeDescription
PathRule.Builder

clearService()

public PathRule.Builder clearService()

The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.

optional string service = 373540533;

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

clearUrlRedirect()

public PathRule.Builder clearUrlRedirect()

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Returns
TypeDescription
PathRule.Builder

clone()

public PathRule.Builder clone()
Returns
TypeDescription
PathRule.Builder
Overrides

getDefaultInstanceForType()

public PathRule getDefaultInstanceForType()
Returns
TypeDescription
PathRule

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getPaths(int index)

public String getPaths(int index)

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The paths at the given index.

getPathsBytes(int index)

public ByteString getPathsBytes(int index)

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the paths at the given index.

getPathsCount()

public int getPathsCount()

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Returns
TypeDescription
int

The count of paths.

getPathsList()

public ProtocolStringList getPathsList()

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Returns
TypeDescription
ProtocolStringList

A list containing the paths.

getRouteAction()

public HttpRouteAction getRouteAction()

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Returns
TypeDescription
HttpRouteAction

The routeAction.

getRouteActionBuilder()

public HttpRouteAction.Builder getRouteActionBuilder()

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Returns
TypeDescription
HttpRouteAction.Builder

getRouteActionOrBuilder()

public HttpRouteActionOrBuilder getRouteActionOrBuilder()

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Returns
TypeDescription
HttpRouteActionOrBuilder

getService()

public String getService()

The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.

optional string service = 373540533;

Returns
TypeDescription
String

The service.

getServiceBytes()

public ByteString getServiceBytes()

The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.

optional string service = 373540533;

Returns
TypeDescription
ByteString

The bytes for service.

getUrlRedirect()

public HttpRedirectAction getUrlRedirect()

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Returns
TypeDescription
HttpRedirectAction

The urlRedirect.

getUrlRedirectBuilder()

public HttpRedirectAction.Builder getUrlRedirectBuilder()

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Returns
TypeDescription
HttpRedirectAction.Builder

getUrlRedirectOrBuilder()

public HttpRedirectActionOrBuilder getUrlRedirectOrBuilder()

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Returns
TypeDescription
HttpRedirectActionOrBuilder

hasRouteAction()

public boolean hasRouteAction()

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Returns
TypeDescription
boolean

Whether the routeAction field is set.

hasService()

public boolean hasService()

The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.

optional string service = 373540533;

Returns
TypeDescription
boolean

Whether the service field is set.

hasUrlRedirect()

public boolean hasUrlRedirect()

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Returns
TypeDescription
boolean

Whether the urlRedirect field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PathRule other)

public PathRule.Builder mergeFrom(PathRule other)
Parameter
NameDescription
otherPathRule
Returns
TypeDescription
PathRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PathRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PathRule.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PathRule.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PathRule.Builder
Overrides

mergeRouteAction(HttpRouteAction value)

public PathRule.Builder mergeRouteAction(HttpRouteAction value)

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Parameter
NameDescription
valueHttpRouteAction
Returns
TypeDescription
PathRule.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PathRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PathRule.Builder
Overrides

mergeUrlRedirect(HttpRedirectAction value)

public PathRule.Builder mergeUrlRedirect(HttpRedirectAction value)

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Parameter
NameDescription
valueHttpRedirectAction
Returns
TypeDescription
PathRule.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public PathRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PathRule.Builder
Overrides

setPaths(int index, String value)

public PathRule.Builder setPaths(int index, String value)

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

repeated string paths = 106438894;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The paths to set.

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

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

public PathRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
PathRule.Builder
Overrides

setRouteAction(HttpRouteAction value)

public PathRule.Builder setRouteAction(HttpRouteAction value)

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Parameter
NameDescription
valueHttpRouteAction
Returns
TypeDescription
PathRule.Builder

setRouteAction(HttpRouteAction.Builder builderForValue)

public PathRule.Builder setRouteAction(HttpRouteAction.Builder builderForValue)

In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction.

optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948;

Parameter
NameDescription
builderForValueHttpRouteAction.Builder
Returns
TypeDescription
PathRule.Builder

setService(String value)

public PathRule.Builder setService(String value)

The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.

optional string service = 373540533;

Parameter
NameDescription
valueString

The service to set.

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

setServiceBytes(ByteString value)

public PathRule.Builder setServiceBytes(ByteString value)

The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.

optional string service = 373540533;

Parameter
NameDescription
valueByteString

The bytes for service to set.

Returns
TypeDescription
PathRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final PathRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PathRule.Builder
Overrides

setUrlRedirect(HttpRedirectAction value)

public PathRule.Builder setUrlRedirect(HttpRedirectAction value)

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Parameter
NameDescription
valueHttpRedirectAction
Returns
TypeDescription
PathRule.Builder

setUrlRedirect(HttpRedirectAction.Builder builderForValue)

public PathRule.Builder setUrlRedirect(HttpRedirectAction.Builder builderForValue)

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy.

optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;

Parameter
NameDescription
builderForValueHttpRedirectAction.Builder
Returns
TypeDescription
PathRule.Builder