- Resource: UrlMap
- JSON representation
- HostRule
- PathMatcher
- HttpRouteAction
- WeightedBackendService
- HttpHeaderAction
- HttpHeaderOption
- UrlRewrite
- HttpRetryPolicy
- RequestMirrorPolicy
- CorsPolicy
- HttpFaultInjection
- HttpFaultDelay
- HttpFaultAbort
- HttpRedirectAction
- RedirectResponseCode
- PathRule
- CustomErrorResponsePolicy
- CustomErrorResponseRule
- HttpRouteRule
- HttpRouteRuleMatch
- HttpHeaderMatch
- Int64RangeMatch
- HttpQueryParameterMatch
- UrlMapTest
- Header
- Methods
Resource: UrlMap
Represents a URL Map resource.
Compute Engine has two URL Map resources:
A URL map resource is a component of certain types of cloud load balancers and Traffic Director:
urlMaps
are used by global external Application Load Balancers, classic Application Load Balancers, and cross-region internal Application Load Balancers. *
regionUrlMaps
are used by internal Application Load Balancers, regional external Application Load Balancers and regional internal Application Load Balancers.
For a list of supported URL map features by the load balancer type, see the Load balancing features: Routing and traffic management table.
For a list of supported URL map features for Traffic Director, see the Traffic Director features: Routing and traffic management table.
This resource defines mappings from hostnames and URL paths to either a backend service or a backend bucket.
To use the global
urlMaps
resource, the backend service must have a
loadBalancingScheme
of either
EXTERNAL
,
EXTERNAL_MANAGED
, or
INTERNAL_SELF_MANAGED
. To use the
regionUrlMaps
resource, the backend service must have a
loadBalancingScheme
of
INTERNAL_MANAGED
. For more information, read URL Map Concepts.
JSON representation |
---|
{ "kind": string, "id": string, "creationTimestamp": string, "name": string, "description": string, "selfLink": string, "hostRules": [ { object ( |
Fields | |
---|---|
kind |
[Output Only] Type of the resource. Always
for url maps. |
id |
[Output Only] The unique identifier for the resource. This identifier is defined by the server. |
creation |
[Output Only] Creation timestamp in RFC3339 text format. |
name |
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 |
description |
An optional description of this resource. Provide this property when you create the resource. |
self |
[Output Only] Server-defined URL for the resource. |
host |
The list of host rules to use against the URL. |
path |
The list of named
to use against the URL. |
tests[] |
The list of expected URL mapping tests. Request to update the
succeeds only if all test cases pass. You can specify a maximum of 100 tests per
. Not supported when the URL map is bound to a target gRPC proxy that has
field set to
. |
default |
The full or partial URL of the
resource to which traffic is directed if none of the
match. If
is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of
,
or
can be set.
has no effect when the URL map is bound to a target gRPC proxy that has the
field set to
. |
default |
takes effect when none of the
match. 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
,
or
can be set. URL maps for classic Application Load Balancers only support the
action within
.
has no effect when the URL map is bound to a target gRPC proxy that has the
field set to
. |
default |
When none of the specified
match, the request is redirected to a URL specified by
. Only one of
,
or
can be set. Not supported when the URL map is bound to a target gRPC proxy. |
header |
Specifies changes to request and response headers that need to take effect for the selected
. The
specified here take effect after
specified under
.
is not supported for load balancers that have their
set to
. Not supported when the URL map is bound to a target gRPC proxy that has
field set to
. |
default |
specifies how the Load Balancer returns error responses when
or
responds with an error. This policy takes effect at the load balancer level and applies only when no policy has been defined for the error code at lower levels like PathMatcher, RouteRule and PathRule within this UrlMap. For example, consider a UrlMap with the following configuration:
If a request for encounters a
, the policy in
will be enforced. When the request for encounters a
, the policy in
will be enforced. When a request that does not match any host in
such as
, encounters a
,
takes effect. When used in conjunction with
, retries take precedence. Only once all retries are exhausted, the
is applied. While attempting a retry, if
is successful in reaching the service, the
is ignored and the response from the service is returned to the client.
is supported only for global external Application Load Balancers. |
fingerprint |
Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field is ignored when inserting a
. An up-to-date fingerprint must be provided in order to update the
, otherwise the request will fail with error
. To see the latest fingerprint, make a
request to retrieve a UrlMap. A base64-encoded string. |
region |
[Output Only] URL of the region where the regional URL map resides. This field is not applicable to global URL maps. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. |
HostRule
UrlMaps A host-matching rule for a URL. If matched, will use the named
PathMatcher
to select the
BackendService
.
JSON representation |
---|
{ "description": string, "hosts": [ string ], "pathMatcher": string } |
Fields | |
---|---|
description |
An optional description of this resource. Provide this property when you create the resource. |
hosts[] |
The list of host patterns to match. They must be valid hostnames with optional port numbers in the format
:
.
matches any string of
. In that case,
must be the first character, and if followed by anything, the immediate following character must be either
or
.
based matching is not supported when the URL map is bound to a target gRPC proxy that has the
field set to
. |
path |
The name of the
to use to match the path portion of the URL if the
matches the URL's host portion. |
PathMatcher
A matcher for the path portion of the URL. The
BackendService
from the longest-matched rule will serve the URL. If no rule was matched, the default service is used.
JSON representation |
---|
{ "name": string, "description": string, "defaultService": string, "defaultRouteAction": { object ( |
Fields | |
---|---|
name |
The name to which this
is referred by the
. |
description |
An optional description of this resource. Provide this property when you create the resource. |
default |
The full or partial URL to the
resource. This URL is used if none of the
or
defined by this
are matched. For example, the following are all valid URLs to a
resource:
is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of
,
or
can be set. Authorization requires one or more of the following Google IAM permissions on the specified resource defaultService:
|
default |
takes effect when none of the
or
match. 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
,
or
can be set. URL maps for classic Application Load Balancers only support the
action within a path matcher's
. |
default |
When none of the specified
or
match, the request is redirected to a URL specified by
. Only one of
,
or
can be set. Not supported when the URL map is bound to a target gRPC proxy. |
path |
The list of path rules. Use this list instead of
when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis. For example: a
with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. Within a given
, only one of
or
must be set. |
route |
The list of HTTP route rules. Use this list instead of
when advanced route matching and routing actions are desired.
are evaluated in order of priority, from the lowest to highest number. Within a given
, you can set only one of
or
. |
header |
Specifies changes to request and response headers that need to take effect for the selected backend service. HeaderAction specified here are applied after the matching
and before the
in the
is not supported for load balancers that have their
set to
. Not supported when the URL map is bound to a target gRPC proxy that has
field set to
. |
default |
specifies how the Load Balancer returns error responses when
or
responds with an error. This policy takes effect at the
level and applies only when no policy has been defined for the error code at lower levels like
and
within this
. If an error code does not have a policy defined in
, then a policy defined for the error code in
takes effect. For example, consider a UrlMap with the following configuration:
If the request is for
and a
is encountered, the policy under
takes effect. If a
response is encountered for the request
, the pathMatcher's policy takes effect. If however, the request for
encounters a
, the policy in
takes effect. If any of the requests in this example encounter a
error code, the policy at
takes effect. When used in conjunction with
, retries take precedence. Only once all retries are exhausted, the
is applied. While attempting a retry, if
is successful in reaching the service, the
is ignored and the response from the service is returned to the client.
is supported only for global external Application Load Balancers. |
HttpRouteAction
JSON representation |
---|
{ "weightedBackendServices": [ { object ( |
Fields | |
---|---|
weighted |
A list of weighted backend services to send traffic to when a route match occurs. The weights determine the fraction of traffic that flows to their corresponding
. If all traffic needs to go to a single backend service, there must be one
with weight set to a non-zero number. After a backend service is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this
. |
url |
The spec to modify the URL of the request, before forwarding the request to the matched service.
is the only action supported in UrlMaps for classic Application Load Balancers. Not supported when the URL map is bound to a target gRPC proxy that has the
field set to
. |
timeout |
Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (known as end-of-stream) up until the response has been processed. Timeout includes all retries. If not specified, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has
field set to
. |
retry |
Specifies the retry policy associated with this route. |
request |
Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer does not wait for responses from the shadow service. Before sending traffic to the shadow service, the host / authority header is suffixed with
. Not supported when the URL map is bound to a target gRPC proxy that has the
field set to
. |
cors |
The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard. Not supported when the URL map is bound to a target gRPC proxy. |
fault |
The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests.
and
is ignored by clients that are configured with a
if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection. Fault injection is not supported with the classic Application Load Balancer . To see which load balancers support fault injection, see Load balancing: Routing and traffic management features. |
max |
Specifies the maximum duration (timeout) for streams on the selected route. Unlike the
field where the timeout duration starts from the time the request has been fully processed (known as end-of-stream), the duration in this field is computed from the beginning of the stream until the response has been processed, including all retries. A stream that does not complete in this duration is closed. If not specified, this field uses the maximum
value among all backend services associated with the route. This field is only allowed if the Url map is used with backend services with
set to
. |
WeightedBackendService
In contrast to a single
BackendService
in
HttpRouteAction
to which all matching traffic is directed to,
WeightedBackendService
allows traffic to be split across multiple backend services. The volume of traffic for each backend service is proportional to the weight specified in each
WeightedBackendService
JSON representation |
---|
{
"backendService": string,
"weight": integer,
"headerAction": {
object ( |
Fields | |
---|---|
backend |
The full or partial URL to the default
resource. Before forwarding the request to
, the load balancer applies any relevant
specified as part of this
. |
weight |
Specifies the fraction of traffic sent to a backend service, computed as
. The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. Don't configure session affinity if you're using weighted traffic splitting. If you do, the weighted traffic splitting configuration takes precedence. The value must be from 0 to 1000. |
header |
Specifies changes to request and response headers that need to take effect for the selected
.
specified here take effect before
in the enclosing
,
and
.
is not supported for load balancers that have their
set to
. Not supported when the URL map is bound to a target gRPC proxy that has
field set to
. |
HttpHeaderAction
The request and response header transformations that take effect before the request is passed along to the selected
backendService
.
JSON representation |
---|
{ "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { object ( |
Fields | |
---|---|
request |
A list of header names for headers that need to be removed from the request before forwarding the request to the
. |
request |
Headers to add to a matching request before forwarding the request to the
. |
response |
A list of header names for headers that need to be removed from the response before sending the response back to the client. |
response |
Headers to add the response before sending the response back to the client. |
HttpHeaderOption
Specification determining how headers are added to requests or responses.
JSON representation |
---|
{ "headerName": string, "headerValue": string, "replace": boolean } |
Fields | |
---|---|
header |
The name of the header. |
header |
The value of the header to add. |
replace |
If
,
is appended to any values that already exist for the header. If true,
is set for the header, discarding any values that were set for that header. The default value is
. |
UrlRewrite
The spec for modifying the path before sending the request to the matched backend service.
JSON representation |
---|
{ "pathPrefixRewrite": string, "hostRewrite": string, "pathTemplateRewrite": string } |
Fields | |
---|---|
path |
Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by
. The value must be from 1 to 1024 characters. |
host |
Before forwarding the request to the selected service, the request's host header is replaced with contents of
. The value must be from 1 to 255 characters. |
path |
If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding pathTemplateMatch must be specified. Any template variables must exist in the pathTemplateMatch field.
For example, a pathTemplateMatch of
could be rewritten as
to prefix
to the URL. Variables can also be re-ordered in a rewrite, so that
can be rewritten as
. At least one non-empty
is required. Only one of
or
may be specified. |
HttpRetryPolicy
The retry policy associates with
HttpRouteRule
JSON representation |
---|
{
"retryConditions": [
string
],
"numRetries": integer,
"perTryTimeout": {
object ( |
Fields | |
---|---|
retry |
Specifies one or more conditions when this retry policy applies. Valid values are:
Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true.
|
num |
Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. |
per |
Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the
field. If timeout in the
field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the
field set to
. |
RequestMirrorPolicy
A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer doesn't wait for responses from the shadow service. Before sending traffic to the shadow service, the host or authority header is suffixed with
-shadow
.
JSON representation |
---|
{ "backendService": string } |
Fields | |
---|---|
backend |
The full or partial URL to the
resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. |
CorsPolicy
The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.
JSON representation |
---|
{ "allowOrigins": [ string ], "allowOriginRegexes": [ string ], "allowMethods": [ string ], "allowHeaders": [ string ], "exposeHeaders": [ string ], "maxAge": integer, "allowCredentials": boolean, "disabled": boolean } |
Fields | |
---|---|
allow |
Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in
or an item in
. |
allow |
Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in
or an item in
. Regular expressions can only be used when the loadBalancingScheme is set to
. |
allow |
Specifies the content for the
header. |
allow |
Specifies the content for the
header. |
expose |
Specifies the content for the
header. |
max |
Specifies how long results of a preflight request can be cached in seconds. This field translates to the
header. |
allow |
In response to a preflight request, setting this to
indicates that the actual request can include user credentials. This field translates to the
header. Default is
. |
disabled |
If
, disables the CORS policy. The default value is
, which indicates that the CORS policy is in effect. |
HttpFaultInjection
The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by the load balancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests.
JSON representation |
---|
{ "delay": { object ( |
Fields | |
---|---|
delay |
The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. |
abort |
The specification for how client requests are aborted as part of fault injection. |
HttpFaultDelay
Specifies the delay introduced by the load balancer before forwarding the request to the backend service as part of fault injection.
JSON representation |
---|
{
"fixedDelay": {
object ( |
Fields | |
---|---|
fixed |
Specifies the value of the fixed delay interval. |
percentage |
The percentage of traffic for connections, operations, or requests for which a delay is introduced as part of fault injection. The value must be from 0.0 to 100.0 inclusive. |
HttpFaultAbort
Specification for how requests are aborted as part of fault injection.
JSON representation |
---|
{ "httpStatus": integer, "percentage": number } |
Fields | |
---|---|
http |
The HTTP status code used to abort the request. The value must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director. |
percentage |
The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection. The value must be from 0.0 to 100.0 inclusive. |
HttpRedirectAction
Specifies settings for an HTTP redirect.
JSON representation |
---|
{
"hostRedirect": string,
"pathRedirect": string,
"prefixRedirect": string,
"redirectResponseCode": enum ( |
Fields | |
---|---|
host |
The host that is used in the redirect response instead of the one that was supplied in the request. The value must be from 1 to 255 characters. |
path |
The path that is used in the redirect response instead of the one that was supplied in the request.
cannot be supplied together with
. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. |
prefix |
The prefix that replaces the
specified in the
, retaining the remaining portion of the URL before redirecting the request.
cannot be supplied together with
. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. |
redirect |
The HTTP Status code to use for this RedirectAction. Supported values are:
|
https |
If set to
, the URL scheme in the redirected request is set to
. If set to
, the URL scheme of the redirected request remains the same as that of the request. This must only be set for URL maps used in
s. Setting this true for
is not permitted. The default is set to
. |
strip |
If set to
, any accompanying query portion of the original URL is removed before redirecting the request. If set to
, the query portion of the original URL is retained. The default is set to
. |
RedirectResponseCode
HTTP Status codes to use for RedirectAction.
Enums | |
---|---|
MOVED_PERMANENTLY_DEFAULT |
Http Status Code 301 - Moved Permanently. |
FOUND |
Http Status Code 302 - Found. |
SEE_OTHER |
Http Status Code 303 - See Other. |
TEMPORARY_REDIRECT |
Http Status Code 307 - Temporary Redirect maintaining HTTP method. |
PERMANENT_REDIRECT |
Http Status Code 308 - Permanent Redirect maintaining HTTP method. |
PathRule
A path-matching rule for a URL. If matched, will use the specified
BackendService
to handle the traffic arriving at this URL.
JSON representation |
---|
{ "service": string, "routeAction": { object ( |
Fields | |
---|---|
service |
The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If
is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of
,
or
can be set. |
route |
In response to a matching
, 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
,
or
can be set. URL maps for classic Application Load Balancers only support the
action within a path rule's
. |
url |
When a path pattern is matched, the request is redirected to a URL specified by
. Only one of
,
or
can be set. Not supported when the URL map is bound to a target gRPC proxy. |
paths[] |
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. |
custom |
specifies how the Load Balancer returns error responses when
or
responds with an error. If a policy for an error code is not configured for the
, a policy for the error code configured in
is applied. If one is not specified in
, the policy configured in
takes effect. For example, consider a UrlMap with the following configuration:
If the request is for
and a
is encountered, the policy under
takes effect. If a
response is encountered for the request
, the pathMatcher's policy takes effect. If however, the request for
encounters a
, the policy in
takes effect. If any of the requests in this example encounter a
error code, the policy at
takes effect.
is supported only for global external Application Load Balancers. |
CustomErrorResponsePolicy
Specifies the custom error response policy that must be applied when the backend service or backend bucket responds with an error.
JSON representation |
---|
{
"errorResponseRules": [
{
object ( |
Fields | |
---|---|
error |
Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for
(Un-authorized) code, and another for all 4 series error codes
. If the backend service returns a
, then the rule for
will be applied. However if the backend service returns a
, the rule for
takes effect. |
error |
The full or partial URL to the
resource that contains the custom error content. Examples are:
If
is not specified at lower levels like
,
and
, an
specified at a higher level in the
will be used. If
contains one or more
, it must specify
. If
cannot reach the
, a simple
will be returned, with the original response code (or
if configured).
is not supported for internal or regional
load balancers. |
CustomErrorResponseRule
Specifies the mapping between the response code that will be returned along with the custom error content and the response code returned by the backend service.
JSON representation |
---|
{ "matchResponseCodes": [ string ], "path": string, "overrideResponseCode": integer } |
Fields | |
---|---|
match |
Valid values include:
Values must be unique within matchResponseCodes and across all
of
. |
path |
The full path to a file within
. For example:
must start with a leading slash.
cannot have trailing slashes. If the file is not available in
or the load balancer cannot reach the
, a simple
is returned to the client. The value must be from
to
characters |
override |
The HTTP status code returned with the response containing the custom error content. If
is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. |
HttpRouteRule
The
HttpRouteRule
setting specifies how to match an HTTP request and the corresponding routing action that load balancing proxies perform.
JSON representation |
---|
{ "priority": integer, "description": string, "matchRules": [ { object ( |
Fields | |
---|---|
priority |
For
within a given
, priority determines the order in which a load balancer interprets
.
are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied. You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number from 0 to 2147483647 inclusive. Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules. |
description |
The short description conveying the intent of this
. The description can have a maximum length of 1024 characters. |
match |
The list of criteria for matching attributes of a request to this
. This list has OR semantics: the request matches this
when any of the
are satisfied. However predicates within a given
have AND semantics. All predicates within a
must match for the request to match the rule. |
service |
The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If
is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of
,
or
can be set. |
route |
In response to a matching
, 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
,
or
can be set. URL maps for classic Application Load Balancers only support the
action within a route rule's
. |
url |
When this rule is matched, the request is redirected to a URL specified by
. Only one of
,
or
can be set. Not supported when the URL map is bound to a target gRPC proxy. |
header |
Specifies changes to request and response headers that need to take effect for the selected
. The
value specified here is applied before the matching
and after
is not supported for load balancers that have their
set to
. Not supported when the URL map is bound to a target gRPC proxy that has
field set to
. |
custom |
specifies how the Load Balancer returns error responses when
or
responds with an error. If a policy for an error code is not configured for the
, a policy for the error code configured in
is applied. If one is not specified in
, the policy configured in
takes effect. For example, consider a UrlMap with the following configuration:
If the request is for
and a
is encountered, the policy under
takes effect. If a
response is encountered for the request
, the pathMatcher's policy takes effect. If however, the request for
encounters a
, the policy in
takes effect. If any of the requests in this example encounter a
error code, the policy at
takes effect. When used in conjunction with
, retries take precedence. Only once all retries are exhausted, the
is applied. While attempting a retry, if
is successful in reaching the service, the
is ignored and the response from the service is returned to the client.
is supported only for global external Application Load Balancers. |
HttpRouteRuleMatch
HttpRouteRuleMatch
specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur.
JSON representation |
---|
{ "prefixMatch": string, "fullPathMatch": string, "regexMatch": string, "ignoreCase": boolean, "headerMatches": [ { object ( |
Fields | |
---|---|
prefix |
For satisfying the
condition, the request's path must begin with the specified
.
must begin with a
. The value must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. |
full |
For satisfying the
condition, the path of the request must exactly match the value specified in
after removing any query parameters and anchor that may be part of the original URL.
must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. |
regex |
For satisfying the
condition, the path of the request must satisfy the regular expression specified in
after removing any query parameters and anchor supplied with the original URL. For more information about regular expression syntax, see Syntax. Only one of
,
or
must be specified. Regular expressions can only be used when the loadBalancingScheme is set to
. |
ignore |
Specifies that
and
matches are case sensitive. The default value is false. ignoreCase must not be used with regexMatch. Not supported when the URL map is bound to a target gRPC proxy. |
header |
Specifies a list of header match criteria, all of which must match corresponding headers in the request. |
query |
Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request. Not supported when the URL map is bound to a target gRPC proxy. |
metadata |
Opaque filter criteria used by the load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to the load balancer, xDS clients present node metadata. When there is a match, the relevant routing configuration is made available to those proxies. For each
in this list, if its
is set to MATCH_ANY, at least one of the
must match the corresponding label provided in the metadata. If its
is set to MATCH_ALL, then all of its
must match with corresponding labels provided in the metadata. If multiple metadata filters are specified, all of them need to be satisfied in order to be considered a match.
specified here is applied after those specified in
that refers to the
this
belongs to.
only applies to load balancers that have
set to
. Not supported when the URL map is bound to a target gRPC proxy that has
field set to
. |
path |
If specified, the route is a pattern match expression that must match the :path header once the query string is removed. A pattern match allows you to match
Precisely one of
,
,
or
must be set. |
HttpHeaderMatch
matchRule
criteria for request header matches.
JSON representation |
---|
{
"headerName": string,
"exactMatch": string,
"regexMatch": string,
"rangeMatch": {
object ( |
Fields | |
---|---|
header |
The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method". When the URL map is bound to a target gRPC proxy that has the
field set to
, only non-binary user-specified custom metadata and the |
exact |
The value should exactly match contents of
. Only one of
,
,
,
,
or
must be set. |
regex |
The value of the header must match the regular expression specified in
. For more information about regular expression syntax, see Syntax. For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. Only one of
,
,
,
,
or
must be set. Regular expressions can only be used when the loadBalancingScheme is set to
. |
range |
The header value must be an integer and its value must be in the range specified in
. If the header does not contain an integer, number or is empty, the match fails. For example for a range [-5, 0]
Only one of
,
,
,
,
or
must be set.
is not supported for load balancers that have
set to
. |
present |
A header with the contents of
must exist. The match takes place whether or not the request's header has a value. Only one of
,
,
,
,
or
must be set. |
prefix |
The value of the header must start with the contents of
. Only one of
,
,
,
,
or
must be set. |
suffix |
The value of the header must end with the contents of
. Only one of
,
,
,
,
or
must be set. |
invert |
If set to
, the
is considered a match if the preceding match criteria are met. If set to
, the
is considered a match if the preceding match criteria are NOT met. The default setting is
. |
Int64RangeMatch
HttpRouteRuleMatch
criteria for field values that must stay within the specified integer range.
JSON representation |
---|
{ "rangeStart": string, "rangeEnd": string } |
Fields | |
---|---|
range |
The start of the range (inclusive) in signed long integer format. |
range |
The end of the range (exclusive) in signed long integer format. |
HttpQueryParameterMatch
HttpRouteRuleMatch
criteria for a request's query parameter.
JSON representation |
---|
{ "name": string, "presentMatch": boolean, "exactMatch": string, "regexMatch": string } |
UrlMapTest
Message for the expected URL mappings.
JSON representation |
---|
{
"description": string,
"host": string,
"path": string,
"headers": [
{
object ( |
Fields | |
---|---|
description |
Description of this test case. |
host |
Host portion of the URL. If
contains a host header, then
must also match the header value. |
path |
Path portion of the URL. |
headers[] |
HTTP headers for this request. If
contains a host header, then
must also match the header value. |
service |
Expected
or
resource the given URL should be mapped to. The
field cannot be set if
is set. |
expected |
The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when
matches the request forwarded by the load balancer to backends. For rules with
, the test verifies that the forwarded request matches
and
in the
action. When
is specified,
`s scheme is ignored. For rules with
, the test passes only if
matches the URL in the load balancer's redirect response. If
specifies
, the test passes only if the scheme in
is also set to
. If
specifies
, the test passes only if
does not contain any query parameters.
is optional when
is specified. |
expected |
For rules with
, the test passes only if
matches the HTTP status code in load balancer's redirect response.
cannot be set when
is set. |
Header
HTTP headers used in UrlMapTests.
JSON representation |
---|
{ "name": string, "value": string } |
Fields | |
---|---|
name |
Header name. |
value |
Header value. |
Methods |
|
---|---|
|
The method compute.v1.RegionUrlMapsService.Delete is not available in this (s3nsapis.fr) universe. |
|
The method compute.v1.RegionUrlMapsService.Get is not available in this (s3nsapis.fr) universe. |
|
The method compute.v1.RegionUrlMapsService.Insert is not available in this (s3nsapis.fr) universe. |
|
The method compute.v1.RegionUrlMapsService.List is not available in this (s3nsapis.fr) universe. |
|
The method compute.v1.RegionUrlMapsService.Patch is not available in this (s3nsapis.fr) universe. |
|
The method compute.v1.RegionUrlMapsService.Update is not available in this (s3nsapis.fr) universe. |
|
The method compute.v1.RegionUrlMapsService.Validate is not available in this (s3nsapis.fr) universe. |