public final class PathRule extends com.google.protobuf.GeneratedMessageV3 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| Modifier and Type | Class and Description |
|---|---|
static class |
PathRule.Builder
A path-matching rule for a URL.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
CUSTOM_ERROR_RESPONSE_POLICY_FIELD_NUMBER |
static int |
PATHS_FIELD_NUMBER |
static int |
ROUTE_ACTION_FIELD_NUMBER |
static int |
SERVICE_FIELD_NUMBER |
static int |
URL_REDIRECT_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
CustomErrorResponsePolicy |
getCustomErrorResponsePolicy()
customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error.
|
CustomErrorResponsePolicyOrBuilder |
getCustomErrorResponsePolicyOrBuilder()
customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error.
|
static PathRule |
getDefaultInstance() |
PathRule |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Parser<PathRule> |
getParserForType() |
String |
getPaths(int index)
The list of path patterns to match.
|
com.google.protobuf.ByteString |
getPathsBytes(int index)
The list of path patterns to match.
|
int |
getPathsCount()
The list of path patterns to match.
|
com.google.protobuf.ProtocolStringList |
getPathsList()
The list of path patterns to match.
|
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.
|
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.
|
int |
getSerializedSize() |
String |
getService()
The full or partial URL of the backend service resource to which traffic is directed if this rule is matched.
|
com.google.protobuf.ByteString |
getServiceBytes()
The full or partial URL of the backend service resource to which traffic is directed if this rule is matched.
|
HttpRedirectAction |
getUrlRedirect()
When a path pattern is matched, the request is redirected to a URL specified by urlRedirect.
|
HttpRedirectActionOrBuilder |
getUrlRedirectOrBuilder()
When a path pattern is matched, the request is redirected to a URL specified by urlRedirect.
|
boolean |
hasCustomErrorResponsePolicy()
customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error.
|
int |
hashCode() |
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.
|
boolean |
hasService()
The full or partial URL of the backend service resource to which traffic is directed if this rule is matched.
|
boolean |
hasUrlRedirect()
When a path pattern is matched, the request is redirected to a URL specified by urlRedirect.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static PathRule.Builder |
newBuilder() |
static PathRule.Builder |
newBuilder(PathRule prototype) |
PathRule.Builder |
newBuilderForType() |
protected PathRule.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static PathRule |
parseDelimitedFrom(InputStream input) |
static PathRule |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PathRule |
parseFrom(byte[] data) |
static PathRule |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PathRule |
parseFrom(ByteBuffer data) |
static PathRule |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PathRule |
parseFrom(com.google.protobuf.ByteString data) |
static PathRule |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PathRule |
parseFrom(com.google.protobuf.CodedInputStream input) |
static PathRule |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static PathRule |
parseFrom(InputStream input) |
static PathRule |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<PathRule> |
parser() |
PathRule.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int CUSTOM_ERROR_RESPONSE_POLICY_FIELD_NUMBER
public static final int PATHS_FIELD_NUMBER
public static final int ROUTE_ACTION_FIELD_NUMBER
public static final int SERVICE_FIELD_NUMBER
public static final int URL_REDIRECT_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public boolean hasCustomErrorResponsePolicy()
customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers.
optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619;
hasCustomErrorResponsePolicy in interface PathRuleOrBuilderpublic CustomErrorResponsePolicy getCustomErrorResponsePolicy()
customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers.
optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619;
getCustomErrorResponsePolicy in interface PathRuleOrBuilderpublic CustomErrorResponsePolicyOrBuilder getCustomErrorResponsePolicyOrBuilder()
customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers.
optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619;
getCustomErrorResponsePolicyOrBuilder in interface PathRuleOrBuilderpublic com.google.protobuf.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;getPathsList in interface PathRuleOrBuilderpublic 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;getPathsCount in interface PathRuleOrBuilderpublic 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;getPaths in interface PathRuleOrBuilderindex - The index of the element to return.public com.google.protobuf.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;getPathsBytes in interface PathRuleOrBuilderindex - The index of the value to return.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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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;hasRouteAction in interface PathRuleOrBuilderpublic 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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;getRouteAction in interface PathRuleOrBuilderpublic 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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;getRouteActionOrBuilder in interface PathRuleOrBuilderpublic 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. Only one of urlRedirect, service or routeAction.weightedBackendService can be set.
optional string service = 373540533;hasService in interface PathRuleOrBuilderpublic 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. Only one of urlRedirect, service or routeAction.weightedBackendService can be set.
optional string service = 373540533;getService in interface PathRuleOrBuilderpublic com.google.protobuf.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. Only one of urlRedirect, service or routeAction.weightedBackendService can be set.
optional string service = 373540533;getServiceBytes in interface PathRuleOrBuilderpublic boolean hasUrlRedirect()
When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. Only one of urlRedirect, service or routeAction.weightedBackendService can be set. Not supported when the URL map is bound to a target gRPC proxy.
optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;hasUrlRedirect in interface PathRuleOrBuilderpublic HttpRedirectAction getUrlRedirect()
When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. Only one of urlRedirect, service or routeAction.weightedBackendService can be set. Not supported when the URL map is bound to a target gRPC proxy.
optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;getUrlRedirect in interface PathRuleOrBuilderpublic HttpRedirectActionOrBuilder getUrlRedirectOrBuilder()
When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. Only one of urlRedirect, service or routeAction.weightedBackendService can be set. Not supported when the URL map is bound to a target gRPC proxy.
optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820;getUrlRedirectOrBuilder in interface PathRuleOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static PathRule parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PathRule parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PathRule parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PathRule parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PathRule parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PathRule parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static PathRule parseFrom(InputStream input) throws IOException
IOExceptionpublic static PathRule parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static PathRule parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static PathRule parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static PathRule parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static PathRule parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic PathRule.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static PathRule.Builder newBuilder()
public static PathRule.Builder newBuilder(PathRule prototype)
public PathRule.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected PathRule.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static PathRule getDefaultInstance()
public static com.google.protobuf.Parser<PathRule> parser()
public com.google.protobuf.Parser<PathRule> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public PathRule getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2025 Google LLC. All rights reserved.