| <html><body> |
| <style> |
| |
| body, h1, h2, h3, div, span, p, pre, a { |
| margin: 0; |
| padding: 0; |
| border: 0; |
| font-weight: inherit; |
| font-style: inherit; |
| font-size: 100%; |
| font-family: inherit; |
| vertical-align: baseline; |
| } |
| |
| body { |
| font-size: 13px; |
| padding: 1em; |
| } |
| |
| h1 { |
| font-size: 26px; |
| margin-bottom: 1em; |
| } |
| |
| h2 { |
| font-size: 24px; |
| margin-bottom: 1em; |
| } |
| |
| h3 { |
| font-size: 20px; |
| margin-bottom: 1em; |
| margin-top: 1em; |
| } |
| |
| pre, code { |
| line-height: 1.5; |
| font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| } |
| |
| pre { |
| margin-top: 0.5em; |
| } |
| |
| h1, h2, h3, p { |
| font-family: Arial, sans serif; |
| } |
| |
| h1, h2, h3 { |
| border-bottom: solid #CCC 1px; |
| } |
| |
| .toc_element { |
| margin-top: 0.5em; |
| } |
| |
| .firstline { |
| margin-left: 2 em; |
| } |
| |
| .method { |
| margin-top: 1em; |
| border: solid 1px #CCC; |
| padding: 1em; |
| background: #EEE; |
| } |
| |
| .details { |
| font-weight: bold; |
| font-size: 14px; |
| } |
| |
| </style> |
| |
| <h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.urlMaps.html">urlMaps</a></h1> |
| <h2>Instance Methods</h2> |
| <p class="toc_element"> |
| <code><a href="#aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None, serviceProjectNumber=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Retrieves the list of all UrlMap resources, regional and global,</p> |
| <p class="toc_element"> |
| <code><a href="#aggregatedList_next">aggregatedList_next()</a></code></p> |
| <p class="firstline">Retrieves the next page of results.</p> |
| <p class="toc_element"> |
| <code><a href="#close">close()</a></code></p> |
| <p class="firstline">Close httplib2 connections.</p> |
| <p class="toc_element"> |
| <code><a href="#delete">delete(project, urlMap, requestId=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Deletes the specified UrlMap resource.</p> |
| <p class="toc_element"> |
| <code><a href="#get">get(project, urlMap, x__xgafv=None)</a></code></p> |
| <p class="firstline">Returns the specified UrlMap resource.</p> |
| <p class="toc_element"> |
| <code><a href="#insert">insert(project, body=None, requestId=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Creates a UrlMap resource in the specified project using</p> |
| <p class="toc_element"> |
| <code><a href="#invalidateCache">invalidateCache(project, urlMap, body=None, requestId=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Initiates a cache invalidation operation, invalidating the specified path,</p> |
| <p class="toc_element"> |
| <code><a href="#list">list(project, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Retrieves the list of UrlMap resources available to the specified</p> |
| <p class="toc_element"> |
| <code><a href="#list_next">list_next()</a></code></p> |
| <p class="firstline">Retrieves the next page of results.</p> |
| <p class="toc_element"> |
| <code><a href="#patch">patch(project, urlMap, body=None, requestId=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Patches the specified UrlMap resource with the data included in the</p> |
| <p class="toc_element"> |
| <code><a href="#testIamPermissions">testIamPermissions(project, resource, body=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Returns permissions that a caller has on the specified resource.</p> |
| <p class="toc_element"> |
| <code><a href="#update">update(project, urlMap, body=None, requestId=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Updates the specified UrlMap resource with the data included in the</p> |
| <p class="toc_element"> |
| <code><a href="#validate">validate(project, urlMap, body=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Runs static validation for the UrlMap. In particular, the tests of the</p> |
| <h3>Method Details</h3> |
| <div class="method"> |
| <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None, serviceProjectNumber=None, x__xgafv=None)</code> |
| <pre>Retrieves the list of all UrlMap resources, regional and global, |
| available to the specified project. |
| |
| To prevent failure, Google recommends that you set the |
| `returnPartialSuccess` parameter to `true`. |
| |
| Args: |
| project: string, Name of the project scoping this request. (required) |
| filter: string, A filter expression that filters resources listed in the response. Most |
| Compute resources support two types of filter expressions: |
| expressions that support regular expressions and expressions that follow |
| API improvement proposal AIP-160. |
| These two types of filter expressions cannot be mixed in one request. |
| |
| If you want to use AIP-160, your expression must specify the field name, an |
| operator, and the value that you want to use for filtering. The value |
| must be a string, a number, or a boolean. The operator |
| must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. |
| |
| For example, if you are filtering Compute Engine instances, you can |
| exclude instances named `example-instance` by specifying |
| `name != example-instance`. |
| |
| The `:*` comparison can be used to test whether a key has been defined. |
| For example, to find all objects with `owner` label use: |
| ``` |
| labels.owner:* |
| ``` |
| |
| You can also filter nested fields. For example, you could specify |
| `scheduling.automaticRestart = false` to include instances only |
| if they are not scheduled for automatic restarts. You can use filtering |
| on nested fields to filter based onresource labels. |
| |
| To filter on multiple expressions, provide each separate expression within |
| parentheses. For example: |
| ``` |
| (scheduling.automaticRestart = true) |
| (cpuPlatform = "Intel Skylake") |
| ``` |
| By default, each expression is an `AND` expression. However, you |
| can include `AND` and `OR` expressions explicitly. |
| For example: |
| ``` |
| (cpuPlatform = "Intel Skylake") OR |
| (cpuPlatform = "Intel Broadwell") AND |
| (scheduling.automaticRestart = true) |
| ``` |
| |
| If you want to use a regular expression, use the `eq` (equal) or `ne` |
| (not equal) operator against a single un-parenthesized expression with or |
| without quotes or against multiple parenthesized expressions. Examples: |
| |
| `fieldname eq unquoted literal` |
| `fieldname eq 'single quoted literal'` |
| `fieldname eq "double quoted literal"` |
| `(fieldname1 eq literal) (fieldname2 ne "literal")` |
| |
| The literal value is interpreted as a regular expression using GoogleRE2 library syntax. |
| The literal value must match the entire field. |
| |
| For example, to filter for instances that do not end with name "instance", |
| you would use `name ne .*instance`. |
| |
| You cannot combine constraints on multiple fields using regular |
| expressions. |
| includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, |
| global) should be included in the response. For new resource types added |
| after this field, the flag has no effect as new resource types will always |
| include every visible scope for each scope type in response. For resource |
| types which predate this field, if this flag is omitted or false, only |
| scopes of the scope types where the resource type is expected to be found |
| will be included. |
| maxResults: integer, The maximum number of results per page that should be returned. |
| If the number of available results is larger than `maxResults`, |
| Compute Engine returns a `nextPageToken` that can be used to get |
| the next page of results in subsequent list requests. Acceptable values are |
| `0` to `500`, inclusive. (Default: `500`) |
| orderBy: string, Sorts list results by a certain order. By default, results |
| are returned in alphanumerical order based on the resource name. |
| |
| You can also sort results in descending order based on the creation |
| timestamp using `orderBy="creationTimestamp desc"`. This sorts |
| results based on the `creationTimestamp` field in |
| reverse chronological order (newest result first). Use this to sort |
| resources like operations so that the newest operation is returned first. |
| |
| Currently, only sorting by `name` or |
| `creationTimestamp desc` is supported. |
| pageToken: string, Specifies a page token to use. Set `pageToken` to the |
| `nextPageToken` returned by a previous list request to get |
| the next page of results. |
| returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case |
| of failure. The default value is false. |
| |
| For example, when partial success behavior is enabled, aggregatedList for a |
| single zone scope either returns all resources in the zone or no resources, |
| with an error code. |
| serviceProjectNumber: string, The Shared VPC service project id or service project number for which |
| aggregated list request is invoked for subnetworks list-usable api. |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { |
| "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. |
| "items": { # A list of UrlMapsScopedList resources. |
| "a_key": { # Name of the scope containing this set of UrlMaps. |
| "urlMaps": [ # A list of UrlMaps contained in this scope. |
| { # Represents a URL Map resource. |
| # |
| # Compute Engine has two URL Map resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/urlMaps) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionUrlMaps) |
| # |
| # 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 aloadBalancingScheme of INTERNAL_MANAGED. For more |
| # information, read URL |
| # Map Concepts. |
| "creationTimestamp": "A String", # [Output Only] Creation timestamp inRFC3339 |
| # text format. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket 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: |
| # |
| # |
| # - defaultCustomErrorResponsePolicy containing policies for |
| # responding to 5xx and 4xx errors |
| # - A PathMatcher configured for *.example.com has |
| # defaultCustomErrorResponsePolicy for 4xx. |
| # |
| # If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. |
| # When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When |
| # a request that does not match any host in *.example.com such |
| # as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only |
| # once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # hostRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within defaultRouteAction. |
| # |
| # |
| # defaultRouteAction has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL of the defaultService resource to |
| # which traffic is directed if none of the hostRules match. |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # defaultService has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request |
| # is redirected to a URL specified by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "fingerprint": "A String", # 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 UrlMap. An up-to-date fingerprint must be provided |
| # in order to update the UrlMap, otherwise the request will |
| # fail with error 412 conditionNotMet. |
| # |
| # To see the latest fingerprint, make a get() request to |
| # retrieve a UrlMap. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction specified here take effect afterheaderAction specified under pathMatcher. |
| # |
| # headerAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "hostRules": [ # The list of host rules to use against the URL. |
| { # UrlMaps |
| # A host-matching rule for a URL. If matched, will use the namedPathMatcher to select the BackendService. |
| "description": "A String", # 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 host:port.* matches any string of ([a-z0-9-.]*). 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 validateForProxyless field |
| # set to true. |
| "A String", |
| ], |
| "pathMatcher": "A String", # The name of the PathMatcher to use to match the path portion |
| # of the URL if the hostRule matches the URL's host portion. |
| }, |
| ], |
| "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is |
| # defined by the server. |
| "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for |
| # url maps. |
| "name": "A String", # Name of the resource. Provided by the client when the resource is created. |
| # The name must be 1-63 characters long, and comply withRFC1035. |
| # Specifically, the name must be 1-63 characters long and match the regular |
| # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first |
| # character must be a lowercase letter, and all following characters must |
| # be a dash, lowercase letter, or digit, except the last character, which |
| # cannot be a dash. |
| "pathMatchers": [ # The list of named PathMatchers to use against the URL. |
| { # 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. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # This policy takes |
| # effect at the PathMatcher level and applies only when no |
| # policy has been defined for the error code at lower levels likeRouteRule and PathRule within thisPathMatcher. If an error code does not have a policy defined |
| # in defaultCustomErrorResponsePolicy, then a policy defined for |
| # the error code in UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # For example, consider a UrlMap with the following |
| # configuration: |
| # |
| # |
| # - UrlMap.defaultCustomErrorResponsePolicy is configured |
| # with policies for 5xx and 4xx errors |
| # - A RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withpathMatcher.defaultRouteAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # pathRules or routeRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path matcher'sdefaultRouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL to the BackendService resource. This |
| # URL is used if none of the pathRules orrouteRules defined by this PathMatcher are |
| # matched. For example, the |
| # following are all valid URLs to a BackendService resource: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService |
| # - compute/v1/projects/project/global/backendServices/backendService |
| # - global/backendServices/backendService |
| # |
| # |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Authorization requires one or more of the following Google IAM permissions on the |
| # specified resource default_service: |
| # |
| # |
| # - compute.backendBuckets.use |
| # - compute.backendServices.use |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified pathRules orrouteRules match, the request is redirected to a URL specified |
| # by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backend service. |
| # |
| # HeaderAction specified here are applied after the matchingHttpRouteRule HeaderAction and before theHeaderAction in the UrlMap |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "name": "A String", # The name to which this PathMatcher is referred by theHostRule. |
| "pathRules": [ # The list of path rules. Use this list instead of routeRules |
| # 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 pathRule 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 pathMatcher, only one ofpathRules or routeRules must be set. |
| { # A path-matching rule for a URL. If matched, will use the specifiedBackendService to handle the traffic arriving at this URL. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the PathRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.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 atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "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. |
| "A String", |
| ], |
| "routeAction": { # 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When a path pattern is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| "routeRules": [ # The list of HTTP route rules. Use this list instead ofpathRules when advanced route matching and routing actions are |
| # desired. routeRules are evaluated in order of priority, from |
| # the lowest to highest number. |
| # |
| # Within a given pathMatcher, you can set only one ofpathRules or routeRules. |
| { # The HttpRouteRule setting specifies how to match an HTTP request |
| # and the corresponding routing action that load balancing proxies perform. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the RouteRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withrouteRules.routeAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thecustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the customErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "description": "A String", # The short description conveying the intent of this routeRule. |
| # |
| # |
| # The description can have a maximum length of 1024 characters. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction value specified here is applied before the |
| # matching pathMatchers[].headerAction and afterpathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "httpFilterConfigs": [ # Outbound route specific configuration fornetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterConfigs only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "httpFilterMetadata": [ # Outbound route specific metadata supplied tonetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterMetadata only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # The only configTypeUrl supported istype.googleapis.com/google.protobuf.Struct |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "matchRules": [ # The list of criteria for matching attributes of a request to thisrouteRule. This list has OR semantics: the request matches |
| # this routeRule when any of thematchRules are satisfied. However predicates within |
| # a given matchRule have AND semantics. All predicates |
| # within a matchRule must match for the request to |
| # match the rule. |
| { # HttpRouteRuleMatch specifies a set of criteria for matching |
| # requests to an HttpRouteRule. All specified criteria must |
| # be satisfied for a match to occur. |
| "fullPathMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must exactly match the value specified infullPathMatch after removing any query parameters and anchor |
| # that may be part of the original URL. |
| # |
| # fullPathMatch must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "headerMatches": [ # Specifies a list of header match criteria, all of which must match |
| # corresponding headers in the request. |
| { # matchRule criteria for request header matches. |
| "exactMatch": "A String", # The value should exactly match contents of exactMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "headerName": "A String", # 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 validateForProxyless field set to true, only |
| # non-binary |
| # user-specified custom metadata and the `content-type` header are supported. |
| # The following transport-level headers cannot be used in header matching |
| # rules: |
| # `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, |
| # `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, |
| # `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, |
| # `grpc-timeout` and `grpc-trace-bin`. |
| "invertMatch": True or False, # If set to false, the headerMatch is considered a |
| # match if the preceding match criteria are met. If set to true, |
| # the headerMatch is considered a match if the preceding |
| # match criteria are NOT met. |
| # |
| # The default setting is false. |
| "prefixMatch": "A String", # The value of the header must start with the contents ofprefixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "presentMatch": True or False, # A header with the contents of headerName must exist. The |
| # match takes place whether or not the request's header has a value. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay # The header value must be an integer and its value must be in the range |
| # specified in rangeMatch. If the header does not contain an |
| # integer, number or is empty, the match fails. |
| # |
| # For example for a range [-5, 0] |
| # |
| # |
| # - -3 will match. |
| # - 0 will not match. |
| # - 0.25 will not match. |
| # - -3someString will not match. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # rangeMatch is not supported for load balancers |
| # that have loadBalancingScheme set to EXTERNAL. |
| # within the specified integer range. |
| "rangeEnd": "A String", # The end of the range (exclusive) in signed long integer format. |
| "rangeStart": "A String", # The start of the range (inclusive) in signed long integer format. |
| }, |
| "regexMatch": "A String", # The value of the header must match the regular expression specified inregexMatch. |
| # 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 exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "suffixMatch": "A String", # The value of the header must end with the contents ofsuffixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| }, |
| ], |
| "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch |
| # 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. |
| "metadataFilters": [ # 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 metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels 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. |
| # |
| # metadataFilters specified here is applied after those |
| # specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to. |
| # |
| # metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Opaque filter criteria used by load balancers to restrict routing |
| # configuration to a limited set of load balancing proxies. Proxies and |
| # sidecars involved in load balancing would typically present metadata to the |
| # load balancers that need to match criteria specified here. If a match takes |
| # place, the relevant configuration is made available to those |
| # proxies. |
| # |
| # For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least |
| # one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels must match with |
| # corresponding labels provided in the metadata. |
| # |
| # An example for using metadataFilters would be: if |
| # load balancing involves |
| # Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers. |
| "filterLabels": [ # The list of label value pairs that must match labels in the provided |
| # metadata based on filterMatchCriteria |
| # |
| # This list must not be empty and can have at the most 64 entries. |
| { # MetadataFilter label name value pairs that are expected |
| # to match corresponding labels presented as metadata to the load balancer. |
| "name": "A String", # Name of metadata label. |
| # |
| # The name can have a maximum length of 1024 characters and must be at |
| # least 1 character long. |
| "value": "A String", # The value of the label must match the specified value. |
| # |
| # value can have a maximum length of 1024 characters. |
| }, |
| ], |
| "filterMatchCriteria": "A String", # Specifies how individual filter label matches |
| # within the list of filterLabels and contributes toward the |
| # overall metadataFilter match. |
| # |
| # Supported values are: |
| # |
| # - MATCH_ANY: at least one of the filterLabels |
| # must have a matching label in the provided metadata. |
| # - MATCH_ALL: all filterLabels must have |
| # matching labels in the provided metadata. |
| }, |
| ], |
| "pathTemplateMatch": "A String", # 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 |
| # |
| # |
| # - The value must be between 1 and 1024 characters |
| # - The pattern must start with a leading slash ("/") |
| # - There may be no more than 5 operators in pattern |
| # |
| # Precisely one ofprefix_match, full_path_match,regex_match or path_template_match must be set. |
| "prefixMatch": "A String", # For satisfying the matchRule condition, the request's |
| # path must begin with the specified prefixMatch.prefixMatch must begin with a /. |
| # |
| # The value must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "queryParameterMatches": [ # 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. |
| { # HttpRouteRuleMatch criteria for a request's query parameter. |
| "exactMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter exactly matches the contents of exactMatch. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "name": "A String", # The name of the query parameter to match. The query parameter must exist in |
| # the request, in the absence of which the request match fails. |
| "presentMatch": True or False, # Specifies that the queryParameterMatch matches if the |
| # request contains the query parameter, irrespective of whether the |
| # parameter has a value or not. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "regexMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter matches the regular expression specified byregexMatch. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "regexMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor |
| # supplied with the original URL. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of prefixMatch, fullPathMatch orregexMatch must be |
| # specified. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "priority": 42, # For routeRules within a given pathMatcher, |
| # priority determines the order in which a load balancer interpretsrouteRules. RouteRules 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. |
| "routeAction": { # In response to a matching matchRule, 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a route rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| }, |
| ], |
| "region": "A String", # [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. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "tests": [ # The list of expected URL mapping tests. Request to update theUrlMap succeeds only if all test cases pass. You can specify a |
| # maximum of 100 tests per UrlMap. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Message for the expected URL mappings. |
| "backendServiceWeight": 42, # The weight to use for the supplied host and path when using advanced |
| # routing rules that involve traffic splitting. |
| "description": "A String", # Description of this test case. |
| "expectedOutputUrl": "A String", # 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 whenexpectedOutputUrl matches the request forwarded by |
| # the load balancer to backends. For rules with urlRewrite, |
| # the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored. |
| # |
| # For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer's |
| # redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. |
| # If urlRedirect specifies strip_query, the test |
| # passes only if expectedOutputUrl does not contain any query |
| # parameters. |
| # |
| # expectedOutputUrl is optional whenservice is specified. |
| "expectedRedirectResponseCode": 42, # For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in |
| # load balancer's redirect response. |
| # |
| # expectedRedirectResponseCode cannot be set whenservice is set. |
| "expectedUrlRedirect": "A String", # The expected URL that should be redirected to for the host and path |
| # being tested. |
| # [Deprecated] This field is deprecated. |
| # Use expected_output_url instead. |
| "headers": [ # HTTP headers for this request. If headers contains |
| # a host header, then host must also match the header value. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. If headers contains a host header, |
| # then host must also match the header value. |
| "path": "A String", # Path portion of the URL. |
| "service": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| # |
| # The service field cannot |
| # be set if expectedRedirectResponseCode is set. |
| }, |
| ], |
| }, |
| ], |
| "warning": { # Informational warning which replaces the list of |
| # backend services when the list is empty. |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| }, |
| }, |
| "kind": "compute#urlMapsAggregatedList", # Type of resource. |
| "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for |
| # list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for |
| # the query parameter pageToken in the next list request. |
| # Subsequent list requests will have their own nextPageToken to |
| # continue paging through the results. |
| "selfLink": "A String", # [Output Only] Server-defined URL for this resource. |
| "unreachables": [ # [Output Only] Unreachable resources. |
| "A String", |
| ], |
| "warning": { # [Output Only] Informational warning message. |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="aggregatedList_next">aggregatedList_next()</code> |
| <pre>Retrieves the next page of results. |
| |
| Args: |
| previous_request: The request for the previous page. (required) |
| previous_response: The response from the request for the previous page. (required) |
| |
| Returns: |
| A request object that you can call 'execute()' on to request the next |
| page. Returns None if there are no more items in the collection. |
| </pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="close">close()</code> |
| <pre>Close httplib2 connections.</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="delete">delete(project, urlMap, requestId=None, x__xgafv=None)</code> |
| <pre>Deletes the specified UrlMap resource. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| urlMap: string, Name of the UrlMap resource to delete. (required) |
| requestId: string, An optional request ID to identify requests. Specify a unique request ID so |
| that if you must retry your request, the server will know to ignore the |
| request if it has already been completed. |
| |
| For example, consider a situation where you make an initial request and |
| the request times out. If you make the request again with the same |
| request ID, the server can check if original operation with the same |
| request ID was received, and if so, will ignore the second request. This |
| prevents clients from accidentally creating duplicate commitments. |
| |
| The request ID must be |
| a valid UUID with the exception that zero UUID is not supported |
| (00000000-0000-0000-0000-000000000000). |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # Represents an Operation resource. |
| # |
| # Google Compute Engine has three Operation resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/globalOperations) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionOperations) |
| # * [Zonal](/compute/docs/reference/rest/alpha/zoneOperations) |
| # |
| # You can use an operation resource to manage asynchronous API requests. |
| # For more information, readHandling |
| # API responses. |
| # |
| # Operations can be global, regional or zonal. |
| # |
| # - For global operations, use the `globalOperations` |
| # resource. |
| # - For regional operations, use the |
| # `regionOperations` resource. |
| # - For zonal operations, use |
| # the `zoneOperations` resource. |
| # |
| # |
| # |
| # For more information, read |
| # Global, Regional, and Zonal Resources. |
| # |
| # Note that completed Operation resources have a limited |
| # retention period. |
| "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. |
| # Not present otherwise. |
| "creationTimestamp": "A String", # [Deprecated] This field is deprecated. |
| "description": "A String", # [Output Only] A textual description of the operation, which is |
| # set when the operation is created. |
| "endTime": "A String", # [Output Only] The time that this operation was completed. This value is inRFC3339 |
| # text format. |
| "error": { # [Output Only] If errors are generated during processing of the operation, |
| # this field will be populated. |
| "errors": [ # [Output Only] The array of errors encountered while processing this |
| # operation. |
| { |
| "code": "A String", # [Output Only] The error type identifier for this error. |
| "errorDetails": [ # [Output Only] An optional list of messages that contain the error |
| # details. There is a set of defined message types to use for providing |
| # details.The syntax depends on the error code. For example, |
| # QuotaExceededInfo will have details when the error code is |
| # QUOTA_EXCEEDED. |
| { |
| "errorInfo": { # Describes the cause of the error with structured details. |
| # |
| # Example of an error when contacting the "pubsub.googleapis.com" API when it |
| # is not enabled: |
| # |
| # { "reason": "API_DISABLED" |
| # "domain": "googleapis.com" |
| # "metadata": { |
| # "resource": "projects/123", |
| # "service": "pubsub.googleapis.com" |
| # } |
| # } |
| # |
| # This response indicates that the pubsub.googleapis.com API is not enabled. |
| # |
| # Example of an error that is returned when attempting to create a Spanner |
| # instance in a region that is out of stock: |
| # |
| # { "reason": "STOCKOUT" |
| # "domain": "spanner.googleapis.com", |
| # "metadata": { |
| # "availableRegions": "us-central1,us-east2" |
| # } |
| # } |
| "domain": "A String", # The logical grouping to which the "reason" belongs. The error domain |
| # is typically the registered service name of the tool or product that |
| # generates the error. Example: "pubsub.googleapis.com". If the error is |
| # generated by some common infrastructure, the error domain must be a |
| # globally unique value that identifies the infrastructure. For Google API |
| # infrastructure, the error domain is "googleapis.com". |
| "metadatas": { # Additional structured details about this error. |
| # |
| # Keys must match a regular expression of `a-z+` but should |
| # ideally be lowerCamelCase. Also, they must be limited to 64 characters in |
| # length. When identifying the current value of an exceeded limit, the units |
| # should be contained in the key, not the value. For example, rather than |
| # `{"instanceLimit": "100/request"}`, should be returned as, |
| # `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| # instances that can be created in a single (batch) request. |
| "a_key": "A String", |
| }, |
| "reason": "A String", # The reason of the error. This is a constant value that identifies the |
| # proximate cause of the error. Error reasons are unique within a particular |
| # domain of errors. This should be at most 63 characters and match a |
| # regular expression of `A-Z+[A-Z0-9]`, which represents |
| # UPPER_SNAKE_CASE. |
| }, |
| "help": { # Provides links to documentation or for performing an out of band action. |
| # |
| # For example, if a quota check failed with an error indicating the calling |
| # project hasn't enabled the accessed service, this can contain a URL pointing |
| # directly to the right place in the developer console to flip the bit. |
| "links": [ # URL(s) pointing to additional information on handling the current error. |
| { # Describes a URL link. |
| "description": "A String", # Describes what the link offers. |
| "url": "A String", # The URL of the link. |
| }, |
| ], |
| }, |
| "localizedMessage": { # Provides a localized error message that is safe to return to the user |
| # which can be attached to an RPC error. |
| "locale": "A String", # The locale used following the specification defined at |
| # https://www.rfc-editor.org/rfc/bcp/bcp47.txt. |
| # Examples are: "en-US", "fr-CH", "es-MX" |
| "message": "A String", # The localized error message in the above locale. |
| }, |
| "quotaInfo": { # Additional details for quota exceeded error for resource quota. |
| "dimensions": { # The map holding related quota dimensions. |
| "a_key": "A String", |
| }, |
| "futureLimit": 3.14, # Future quota limit being rolled out. The limit's unit depends on the quota |
| # type or metric. |
| "limit": 3.14, # Current effective quota limit. The limit's unit depends on the quota type |
| # or metric. |
| "limitName": "A String", # The name of the quota limit. |
| "metricName": "A String", # The Compute Engine quota metric name. |
| "rolloutStatus": "A String", # Rollout status of the future quota limit. |
| }, |
| }, |
| ], |
| "location": "A String", # [Output Only] Indicates the field in the request that caused the error. |
| # This property is optional. |
| "message": "A String", # [Output Only] An optional, human-readable error message. |
| }, |
| ], |
| }, |
| "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error |
| # message that was returned, such as `NOT FOUND`. |
| "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error |
| # status code that was returned. For example, a `404` means the |
| # resource was not found. |
| "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is |
| # defined by the server. |
| "insertTime": "A String", # [Output Only] The time that this operation was requested. |
| # This value is inRFC3339 |
| # text format. |
| "instancesBulkInsertOperationMetadata": { |
| "perLocationStatus": { # Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "createdVmCount": 42, # [Output Only] Count of VMs successfully created so far. |
| "deletedVmCount": 42, # [Output Only] Count of VMs that got deleted during rollback. |
| "failedToCreateVmCount": 42, # [Output Only] Count of VMs that started creating but encountered an |
| # error. |
| "status": "A String", # [Output Only] Creation status of BulkInsert operation - information |
| # if the flow is rolling forward or rolling back. |
| "targetVmCount": 42, # [Output Only] Count of VMs originally planned to be created. |
| }, |
| }, |
| }, |
| "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for |
| # Operation resources. |
| "name": "A String", # [Output Only] Name of the operation. |
| "operationGroupId": "A String", # [Output Only] An ID that represents a group of operations, such as when a |
| # group of operations results from a `bulkInsert` API request. |
| "operationType": "A String", # [Output Only] The type of operation, such as `insert`, |
| # `update`, or `delete`, and so on. |
| "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. |
| # There is no requirement that this be linear or support any granularity of |
| # operations. This should not be used to guess when the operation will be |
| # complete. This number should monotonically increase as the operation |
| # progresses. |
| "region": "A String", # [Output Only] The URL of the region where the operation resides. Only |
| # applicable when performing regional operations. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. |
| "setCommonInstanceMetadataOperationMetadata": { # [Output Only] If the operation is for projects.setCommonInstanceMetadata, |
| # this field will contain information on all underlying zonal actions and |
| # their state. |
| "clientOperationId": "A String", # [Output Only] The client operation id. |
| "perLocationOperations": { # [Output Only] Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "error": { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is |
| # populated. |
| # different programming environments, including REST APIs and RPC APIs. It is |
| # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| # three pieces of data: error code, error message, and error details. |
| # |
| # You can find out more about this error model and how to work with it in the |
| # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| "details": [ # A list of messages that carry the error details. There is a common set of |
| # message types for APIs to use. |
| { |
| "a_key": "", # Properties of the object. Contains field @type with type URL. |
| }, |
| ], |
| "message": "A String", # A developer-facing error message, which should be in English. Any |
| # user-facing error message should be localized and sent in the |
| # google.rpc.Status.details field, or localized by the client. |
| }, |
| "state": "A String", # [Output Only] Status of the action, which can be one of the following: |
| # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. |
| }, |
| }, |
| }, |
| "startTime": "A String", # [Output Only] The time that this operation was started by the server. |
| # This value is inRFC3339 |
| # text format. |
| "status": "A String", # [Output Only] The status of the operation, which can be one of the |
| # following: |
| # `PENDING`, `RUNNING`, or `DONE`. |
| "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the |
| # operation. |
| "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation |
| # of the target resource. |
| "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For |
| # operations related to creating a snapshot, this points to the disk |
| # that the snapshot was created from. |
| "user": "A String", # [Output Only] User who requested the operation, for example: |
| # `[email protected]` or |
| # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. |
| "warnings": [ # [Output Only] If warning messages are generated during processing of the |
| # operation, this field will be populated. |
| { |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| ], |
| "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only |
| # applicable when performing per-zone operations. |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="get">get(project, urlMap, x__xgafv=None)</code> |
| <pre>Returns the specified UrlMap resource. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| urlMap: string, Name of the UrlMap resource to return. (required) |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # Represents a URL Map resource. |
| # |
| # Compute Engine has two URL Map resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/urlMaps) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionUrlMaps) |
| # |
| # 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 aloadBalancingScheme of INTERNAL_MANAGED. For more |
| # information, read URL |
| # Map Concepts. |
| "creationTimestamp": "A String", # [Output Only] Creation timestamp inRFC3339 |
| # text format. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket 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: |
| # |
| # |
| # - defaultCustomErrorResponsePolicy containing policies for |
| # responding to 5xx and 4xx errors |
| # - A PathMatcher configured for *.example.com has |
| # defaultCustomErrorResponsePolicy for 4xx. |
| # |
| # If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. |
| # When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When |
| # a request that does not match any host in *.example.com such |
| # as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only |
| # once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # hostRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within defaultRouteAction. |
| # |
| # |
| # defaultRouteAction has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL of the defaultService resource to |
| # which traffic is directed if none of the hostRules match. |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # defaultService has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request |
| # is redirected to a URL specified by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "fingerprint": "A String", # 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 UrlMap. An up-to-date fingerprint must be provided |
| # in order to update the UrlMap, otherwise the request will |
| # fail with error 412 conditionNotMet. |
| # |
| # To see the latest fingerprint, make a get() request to |
| # retrieve a UrlMap. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction specified here take effect afterheaderAction specified under pathMatcher. |
| # |
| # headerAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "hostRules": [ # The list of host rules to use against the URL. |
| { # UrlMaps |
| # A host-matching rule for a URL. If matched, will use the namedPathMatcher to select the BackendService. |
| "description": "A String", # 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 host:port.* matches any string of ([a-z0-9-.]*). 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 validateForProxyless field |
| # set to true. |
| "A String", |
| ], |
| "pathMatcher": "A String", # The name of the PathMatcher to use to match the path portion |
| # of the URL if the hostRule matches the URL's host portion. |
| }, |
| ], |
| "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is |
| # defined by the server. |
| "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for |
| # url maps. |
| "name": "A String", # Name of the resource. Provided by the client when the resource is created. |
| # The name must be 1-63 characters long, and comply withRFC1035. |
| # Specifically, the name must be 1-63 characters long and match the regular |
| # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first |
| # character must be a lowercase letter, and all following characters must |
| # be a dash, lowercase letter, or digit, except the last character, which |
| # cannot be a dash. |
| "pathMatchers": [ # The list of named PathMatchers to use against the URL. |
| { # 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. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # This policy takes |
| # effect at the PathMatcher level and applies only when no |
| # policy has been defined for the error code at lower levels likeRouteRule and PathRule within thisPathMatcher. If an error code does not have a policy defined |
| # in defaultCustomErrorResponsePolicy, then a policy defined for |
| # the error code in UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # For example, consider a UrlMap with the following |
| # configuration: |
| # |
| # |
| # - UrlMap.defaultCustomErrorResponsePolicy is configured |
| # with policies for 5xx and 4xx errors |
| # - A RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withpathMatcher.defaultRouteAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # pathRules or routeRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path matcher'sdefaultRouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL to the BackendService resource. This |
| # URL is used if none of the pathRules orrouteRules defined by this PathMatcher are |
| # matched. For example, the |
| # following are all valid URLs to a BackendService resource: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService |
| # - compute/v1/projects/project/global/backendServices/backendService |
| # - global/backendServices/backendService |
| # |
| # |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Authorization requires one or more of the following Google IAM permissions on the |
| # specified resource default_service: |
| # |
| # |
| # - compute.backendBuckets.use |
| # - compute.backendServices.use |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified pathRules orrouteRules match, the request is redirected to a URL specified |
| # by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backend service. |
| # |
| # HeaderAction specified here are applied after the matchingHttpRouteRule HeaderAction and before theHeaderAction in the UrlMap |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "name": "A String", # The name to which this PathMatcher is referred by theHostRule. |
| "pathRules": [ # The list of path rules. Use this list instead of routeRules |
| # 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 pathRule 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 pathMatcher, only one ofpathRules or routeRules must be set. |
| { # A path-matching rule for a URL. If matched, will use the specifiedBackendService to handle the traffic arriving at this URL. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the PathRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.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 atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "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. |
| "A String", |
| ], |
| "routeAction": { # 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When a path pattern is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| "routeRules": [ # The list of HTTP route rules. Use this list instead ofpathRules when advanced route matching and routing actions are |
| # desired. routeRules are evaluated in order of priority, from |
| # the lowest to highest number. |
| # |
| # Within a given pathMatcher, you can set only one ofpathRules or routeRules. |
| { # The HttpRouteRule setting specifies how to match an HTTP request |
| # and the corresponding routing action that load balancing proxies perform. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the RouteRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withrouteRules.routeAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thecustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the customErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "description": "A String", # The short description conveying the intent of this routeRule. |
| # |
| # |
| # The description can have a maximum length of 1024 characters. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction value specified here is applied before the |
| # matching pathMatchers[].headerAction and afterpathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "httpFilterConfigs": [ # Outbound route specific configuration fornetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterConfigs only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "httpFilterMetadata": [ # Outbound route specific metadata supplied tonetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterMetadata only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # The only configTypeUrl supported istype.googleapis.com/google.protobuf.Struct |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "matchRules": [ # The list of criteria for matching attributes of a request to thisrouteRule. This list has OR semantics: the request matches |
| # this routeRule when any of thematchRules are satisfied. However predicates within |
| # a given matchRule have AND semantics. All predicates |
| # within a matchRule must match for the request to |
| # match the rule. |
| { # HttpRouteRuleMatch specifies a set of criteria for matching |
| # requests to an HttpRouteRule. All specified criteria must |
| # be satisfied for a match to occur. |
| "fullPathMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must exactly match the value specified infullPathMatch after removing any query parameters and anchor |
| # that may be part of the original URL. |
| # |
| # fullPathMatch must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "headerMatches": [ # Specifies a list of header match criteria, all of which must match |
| # corresponding headers in the request. |
| { # matchRule criteria for request header matches. |
| "exactMatch": "A String", # The value should exactly match contents of exactMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "headerName": "A String", # 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 validateForProxyless field set to true, only |
| # non-binary |
| # user-specified custom metadata and the `content-type` header are supported. |
| # The following transport-level headers cannot be used in header matching |
| # rules: |
| # `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, |
| # `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, |
| # `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, |
| # `grpc-timeout` and `grpc-trace-bin`. |
| "invertMatch": True or False, # If set to false, the headerMatch is considered a |
| # match if the preceding match criteria are met. If set to true, |
| # the headerMatch is considered a match if the preceding |
| # match criteria are NOT met. |
| # |
| # The default setting is false. |
| "prefixMatch": "A String", # The value of the header must start with the contents ofprefixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "presentMatch": True or False, # A header with the contents of headerName must exist. The |
| # match takes place whether or not the request's header has a value. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay # The header value must be an integer and its value must be in the range |
| # specified in rangeMatch. If the header does not contain an |
| # integer, number or is empty, the match fails. |
| # |
| # For example for a range [-5, 0] |
| # |
| # |
| # - -3 will match. |
| # - 0 will not match. |
| # - 0.25 will not match. |
| # - -3someString will not match. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # rangeMatch is not supported for load balancers |
| # that have loadBalancingScheme set to EXTERNAL. |
| # within the specified integer range. |
| "rangeEnd": "A String", # The end of the range (exclusive) in signed long integer format. |
| "rangeStart": "A String", # The start of the range (inclusive) in signed long integer format. |
| }, |
| "regexMatch": "A String", # The value of the header must match the regular expression specified inregexMatch. |
| # 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 exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "suffixMatch": "A String", # The value of the header must end with the contents ofsuffixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| }, |
| ], |
| "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch |
| # 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. |
| "metadataFilters": [ # 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 metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels 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. |
| # |
| # metadataFilters specified here is applied after those |
| # specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to. |
| # |
| # metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Opaque filter criteria used by load balancers to restrict routing |
| # configuration to a limited set of load balancing proxies. Proxies and |
| # sidecars involved in load balancing would typically present metadata to the |
| # load balancers that need to match criteria specified here. If a match takes |
| # place, the relevant configuration is made available to those |
| # proxies. |
| # |
| # For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least |
| # one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels must match with |
| # corresponding labels provided in the metadata. |
| # |
| # An example for using metadataFilters would be: if |
| # load balancing involves |
| # Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers. |
| "filterLabels": [ # The list of label value pairs that must match labels in the provided |
| # metadata based on filterMatchCriteria |
| # |
| # This list must not be empty and can have at the most 64 entries. |
| { # MetadataFilter label name value pairs that are expected |
| # to match corresponding labels presented as metadata to the load balancer. |
| "name": "A String", # Name of metadata label. |
| # |
| # The name can have a maximum length of 1024 characters and must be at |
| # least 1 character long. |
| "value": "A String", # The value of the label must match the specified value. |
| # |
| # value can have a maximum length of 1024 characters. |
| }, |
| ], |
| "filterMatchCriteria": "A String", # Specifies how individual filter label matches |
| # within the list of filterLabels and contributes toward the |
| # overall metadataFilter match. |
| # |
| # Supported values are: |
| # |
| # - MATCH_ANY: at least one of the filterLabels |
| # must have a matching label in the provided metadata. |
| # - MATCH_ALL: all filterLabels must have |
| # matching labels in the provided metadata. |
| }, |
| ], |
| "pathTemplateMatch": "A String", # 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 |
| # |
| # |
| # - The value must be between 1 and 1024 characters |
| # - The pattern must start with a leading slash ("/") |
| # - There may be no more than 5 operators in pattern |
| # |
| # Precisely one ofprefix_match, full_path_match,regex_match or path_template_match must be set. |
| "prefixMatch": "A String", # For satisfying the matchRule condition, the request's |
| # path must begin with the specified prefixMatch.prefixMatch must begin with a /. |
| # |
| # The value must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "queryParameterMatches": [ # 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. |
| { # HttpRouteRuleMatch criteria for a request's query parameter. |
| "exactMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter exactly matches the contents of exactMatch. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "name": "A String", # The name of the query parameter to match. The query parameter must exist in |
| # the request, in the absence of which the request match fails. |
| "presentMatch": True or False, # Specifies that the queryParameterMatch matches if the |
| # request contains the query parameter, irrespective of whether the |
| # parameter has a value or not. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "regexMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter matches the regular expression specified byregexMatch. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "regexMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor |
| # supplied with the original URL. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of prefixMatch, fullPathMatch orregexMatch must be |
| # specified. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "priority": 42, # For routeRules within a given pathMatcher, |
| # priority determines the order in which a load balancer interpretsrouteRules. RouteRules 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. |
| "routeAction": { # In response to a matching matchRule, 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a route rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| }, |
| ], |
| "region": "A String", # [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. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "tests": [ # The list of expected URL mapping tests. Request to update theUrlMap succeeds only if all test cases pass. You can specify a |
| # maximum of 100 tests per UrlMap. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Message for the expected URL mappings. |
| "backendServiceWeight": 42, # The weight to use for the supplied host and path when using advanced |
| # routing rules that involve traffic splitting. |
| "description": "A String", # Description of this test case. |
| "expectedOutputUrl": "A String", # 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 whenexpectedOutputUrl matches the request forwarded by |
| # the load balancer to backends. For rules with urlRewrite, |
| # the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored. |
| # |
| # For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer's |
| # redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. |
| # If urlRedirect specifies strip_query, the test |
| # passes only if expectedOutputUrl does not contain any query |
| # parameters. |
| # |
| # expectedOutputUrl is optional whenservice is specified. |
| "expectedRedirectResponseCode": 42, # For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in |
| # load balancer's redirect response. |
| # |
| # expectedRedirectResponseCode cannot be set whenservice is set. |
| "expectedUrlRedirect": "A String", # The expected URL that should be redirected to for the host and path |
| # being tested. |
| # [Deprecated] This field is deprecated. |
| # Use expected_output_url instead. |
| "headers": [ # HTTP headers for this request. If headers contains |
| # a host header, then host must also match the header value. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. If headers contains a host header, |
| # then host must also match the header value. |
| "path": "A String", # Path portion of the URL. |
| "service": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| # |
| # The service field cannot |
| # be set if expectedRedirectResponseCode is set. |
| }, |
| ], |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="insert">insert(project, body=None, requestId=None, x__xgafv=None)</code> |
| <pre>Creates a UrlMap resource in the specified project using |
| the data included in the request. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| body: object, The request body. |
| The object takes the form of: |
| |
| { # Represents a URL Map resource. |
| # |
| # Compute Engine has two URL Map resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/urlMaps) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionUrlMaps) |
| # |
| # 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 aloadBalancingScheme of INTERNAL_MANAGED. For more |
| # information, read URL |
| # Map Concepts. |
| "creationTimestamp": "A String", # [Output Only] Creation timestamp inRFC3339 |
| # text format. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket 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: |
| # |
| # |
| # - defaultCustomErrorResponsePolicy containing policies for |
| # responding to 5xx and 4xx errors |
| # - A PathMatcher configured for *.example.com has |
| # defaultCustomErrorResponsePolicy for 4xx. |
| # |
| # If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. |
| # When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When |
| # a request that does not match any host in *.example.com such |
| # as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only |
| # once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # hostRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within defaultRouteAction. |
| # |
| # |
| # defaultRouteAction has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL of the defaultService resource to |
| # which traffic is directed if none of the hostRules match. |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # defaultService has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request |
| # is redirected to a URL specified by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "fingerprint": "A String", # 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 UrlMap. An up-to-date fingerprint must be provided |
| # in order to update the UrlMap, otherwise the request will |
| # fail with error 412 conditionNotMet. |
| # |
| # To see the latest fingerprint, make a get() request to |
| # retrieve a UrlMap. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction specified here take effect afterheaderAction specified under pathMatcher. |
| # |
| # headerAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "hostRules": [ # The list of host rules to use against the URL. |
| { # UrlMaps |
| # A host-matching rule for a URL. If matched, will use the namedPathMatcher to select the BackendService. |
| "description": "A String", # 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 host:port.* matches any string of ([a-z0-9-.]*). 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 validateForProxyless field |
| # set to true. |
| "A String", |
| ], |
| "pathMatcher": "A String", # The name of the PathMatcher to use to match the path portion |
| # of the URL if the hostRule matches the URL's host portion. |
| }, |
| ], |
| "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is |
| # defined by the server. |
| "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for |
| # url maps. |
| "name": "A String", # Name of the resource. Provided by the client when the resource is created. |
| # The name must be 1-63 characters long, and comply withRFC1035. |
| # Specifically, the name must be 1-63 characters long and match the regular |
| # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first |
| # character must be a lowercase letter, and all following characters must |
| # be a dash, lowercase letter, or digit, except the last character, which |
| # cannot be a dash. |
| "pathMatchers": [ # The list of named PathMatchers to use against the URL. |
| { # 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. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # This policy takes |
| # effect at the PathMatcher level and applies only when no |
| # policy has been defined for the error code at lower levels likeRouteRule and PathRule within thisPathMatcher. If an error code does not have a policy defined |
| # in defaultCustomErrorResponsePolicy, then a policy defined for |
| # the error code in UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # For example, consider a UrlMap with the following |
| # configuration: |
| # |
| # |
| # - UrlMap.defaultCustomErrorResponsePolicy is configured |
| # with policies for 5xx and 4xx errors |
| # - A RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withpathMatcher.defaultRouteAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # pathRules or routeRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path matcher'sdefaultRouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL to the BackendService resource. This |
| # URL is used if none of the pathRules orrouteRules defined by this PathMatcher are |
| # matched. For example, the |
| # following are all valid URLs to a BackendService resource: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService |
| # - compute/v1/projects/project/global/backendServices/backendService |
| # - global/backendServices/backendService |
| # |
| # |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Authorization requires one or more of the following Google IAM permissions on the |
| # specified resource default_service: |
| # |
| # |
| # - compute.backendBuckets.use |
| # - compute.backendServices.use |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified pathRules orrouteRules match, the request is redirected to a URL specified |
| # by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backend service. |
| # |
| # HeaderAction specified here are applied after the matchingHttpRouteRule HeaderAction and before theHeaderAction in the UrlMap |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "name": "A String", # The name to which this PathMatcher is referred by theHostRule. |
| "pathRules": [ # The list of path rules. Use this list instead of routeRules |
| # 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 pathRule 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 pathMatcher, only one ofpathRules or routeRules must be set. |
| { # A path-matching rule for a URL. If matched, will use the specifiedBackendService to handle the traffic arriving at this URL. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the PathRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.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 atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "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. |
| "A String", |
| ], |
| "routeAction": { # 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When a path pattern is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| "routeRules": [ # The list of HTTP route rules. Use this list instead ofpathRules when advanced route matching and routing actions are |
| # desired. routeRules are evaluated in order of priority, from |
| # the lowest to highest number. |
| # |
| # Within a given pathMatcher, you can set only one ofpathRules or routeRules. |
| { # The HttpRouteRule setting specifies how to match an HTTP request |
| # and the corresponding routing action that load balancing proxies perform. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the RouteRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withrouteRules.routeAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thecustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the customErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "description": "A String", # The short description conveying the intent of this routeRule. |
| # |
| # |
| # The description can have a maximum length of 1024 characters. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction value specified here is applied before the |
| # matching pathMatchers[].headerAction and afterpathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "httpFilterConfigs": [ # Outbound route specific configuration fornetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterConfigs only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "httpFilterMetadata": [ # Outbound route specific metadata supplied tonetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterMetadata only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # The only configTypeUrl supported istype.googleapis.com/google.protobuf.Struct |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "matchRules": [ # The list of criteria for matching attributes of a request to thisrouteRule. This list has OR semantics: the request matches |
| # this routeRule when any of thematchRules are satisfied. However predicates within |
| # a given matchRule have AND semantics. All predicates |
| # within a matchRule must match for the request to |
| # match the rule. |
| { # HttpRouteRuleMatch specifies a set of criteria for matching |
| # requests to an HttpRouteRule. All specified criteria must |
| # be satisfied for a match to occur. |
| "fullPathMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must exactly match the value specified infullPathMatch after removing any query parameters and anchor |
| # that may be part of the original URL. |
| # |
| # fullPathMatch must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "headerMatches": [ # Specifies a list of header match criteria, all of which must match |
| # corresponding headers in the request. |
| { # matchRule criteria for request header matches. |
| "exactMatch": "A String", # The value should exactly match contents of exactMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "headerName": "A String", # 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 validateForProxyless field set to true, only |
| # non-binary |
| # user-specified custom metadata and the `content-type` header are supported. |
| # The following transport-level headers cannot be used in header matching |
| # rules: |
| # `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, |
| # `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, |
| # `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, |
| # `grpc-timeout` and `grpc-trace-bin`. |
| "invertMatch": True or False, # If set to false, the headerMatch is considered a |
| # match if the preceding match criteria are met. If set to true, |
| # the headerMatch is considered a match if the preceding |
| # match criteria are NOT met. |
| # |
| # The default setting is false. |
| "prefixMatch": "A String", # The value of the header must start with the contents ofprefixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "presentMatch": True or False, # A header with the contents of headerName must exist. The |
| # match takes place whether or not the request's header has a value. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay # The header value must be an integer and its value must be in the range |
| # specified in rangeMatch. If the header does not contain an |
| # integer, number or is empty, the match fails. |
| # |
| # For example for a range [-5, 0] |
| # |
| # |
| # - -3 will match. |
| # - 0 will not match. |
| # - 0.25 will not match. |
| # - -3someString will not match. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # rangeMatch is not supported for load balancers |
| # that have loadBalancingScheme set to EXTERNAL. |
| # within the specified integer range. |
| "rangeEnd": "A String", # The end of the range (exclusive) in signed long integer format. |
| "rangeStart": "A String", # The start of the range (inclusive) in signed long integer format. |
| }, |
| "regexMatch": "A String", # The value of the header must match the regular expression specified inregexMatch. |
| # 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 exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "suffixMatch": "A String", # The value of the header must end with the contents ofsuffixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| }, |
| ], |
| "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch |
| # 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. |
| "metadataFilters": [ # 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 metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels 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. |
| # |
| # metadataFilters specified here is applied after those |
| # specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to. |
| # |
| # metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Opaque filter criteria used by load balancers to restrict routing |
| # configuration to a limited set of load balancing proxies. Proxies and |
| # sidecars involved in load balancing would typically present metadata to the |
| # load balancers that need to match criteria specified here. If a match takes |
| # place, the relevant configuration is made available to those |
| # proxies. |
| # |
| # For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least |
| # one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels must match with |
| # corresponding labels provided in the metadata. |
| # |
| # An example for using metadataFilters would be: if |
| # load balancing involves |
| # Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers. |
| "filterLabels": [ # The list of label value pairs that must match labels in the provided |
| # metadata based on filterMatchCriteria |
| # |
| # This list must not be empty and can have at the most 64 entries. |
| { # MetadataFilter label name value pairs that are expected |
| # to match corresponding labels presented as metadata to the load balancer. |
| "name": "A String", # Name of metadata label. |
| # |
| # The name can have a maximum length of 1024 characters and must be at |
| # least 1 character long. |
| "value": "A String", # The value of the label must match the specified value. |
| # |
| # value can have a maximum length of 1024 characters. |
| }, |
| ], |
| "filterMatchCriteria": "A String", # Specifies how individual filter label matches |
| # within the list of filterLabels and contributes toward the |
| # overall metadataFilter match. |
| # |
| # Supported values are: |
| # |
| # - MATCH_ANY: at least one of the filterLabels |
| # must have a matching label in the provided metadata. |
| # - MATCH_ALL: all filterLabels must have |
| # matching labels in the provided metadata. |
| }, |
| ], |
| "pathTemplateMatch": "A String", # 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 |
| # |
| # |
| # - The value must be between 1 and 1024 characters |
| # - The pattern must start with a leading slash ("/") |
| # - There may be no more than 5 operators in pattern |
| # |
| # Precisely one ofprefix_match, full_path_match,regex_match or path_template_match must be set. |
| "prefixMatch": "A String", # For satisfying the matchRule condition, the request's |
| # path must begin with the specified prefixMatch.prefixMatch must begin with a /. |
| # |
| # The value must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "queryParameterMatches": [ # 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. |
| { # HttpRouteRuleMatch criteria for a request's query parameter. |
| "exactMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter exactly matches the contents of exactMatch. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "name": "A String", # The name of the query parameter to match. The query parameter must exist in |
| # the request, in the absence of which the request match fails. |
| "presentMatch": True or False, # Specifies that the queryParameterMatch matches if the |
| # request contains the query parameter, irrespective of whether the |
| # parameter has a value or not. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "regexMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter matches the regular expression specified byregexMatch. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "regexMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor |
| # supplied with the original URL. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of prefixMatch, fullPathMatch orregexMatch must be |
| # specified. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "priority": 42, # For routeRules within a given pathMatcher, |
| # priority determines the order in which a load balancer interpretsrouteRules. RouteRules 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. |
| "routeAction": { # In response to a matching matchRule, 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a route rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| }, |
| ], |
| "region": "A String", # [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. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "tests": [ # The list of expected URL mapping tests. Request to update theUrlMap succeeds only if all test cases pass. You can specify a |
| # maximum of 100 tests per UrlMap. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Message for the expected URL mappings. |
| "backendServiceWeight": 42, # The weight to use for the supplied host and path when using advanced |
| # routing rules that involve traffic splitting. |
| "description": "A String", # Description of this test case. |
| "expectedOutputUrl": "A String", # 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 whenexpectedOutputUrl matches the request forwarded by |
| # the load balancer to backends. For rules with urlRewrite, |
| # the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored. |
| # |
| # For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer's |
| # redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. |
| # If urlRedirect specifies strip_query, the test |
| # passes only if expectedOutputUrl does not contain any query |
| # parameters. |
| # |
| # expectedOutputUrl is optional whenservice is specified. |
| "expectedRedirectResponseCode": 42, # For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in |
| # load balancer's redirect response. |
| # |
| # expectedRedirectResponseCode cannot be set whenservice is set. |
| "expectedUrlRedirect": "A String", # The expected URL that should be redirected to for the host and path |
| # being tested. |
| # [Deprecated] This field is deprecated. |
| # Use expected_output_url instead. |
| "headers": [ # HTTP headers for this request. If headers contains |
| # a host header, then host must also match the header value. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. If headers contains a host header, |
| # then host must also match the header value. |
| "path": "A String", # Path portion of the URL. |
| "service": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| # |
| # The service field cannot |
| # be set if expectedRedirectResponseCode is set. |
| }, |
| ], |
| } |
| |
| requestId: string, An optional request ID to identify requests. Specify a unique request ID so |
| that if you must retry your request, the server will know to ignore the |
| request if it has already been completed. |
| |
| For example, consider a situation where you make an initial request and |
| the request times out. If you make the request again with the same |
| request ID, the server can check if original operation with the same |
| request ID was received, and if so, will ignore the second request. This |
| prevents clients from accidentally creating duplicate commitments. |
| |
| The request ID must be |
| a valid UUID with the exception that zero UUID is not supported |
| (00000000-0000-0000-0000-000000000000). |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # Represents an Operation resource. |
| # |
| # Google Compute Engine has three Operation resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/globalOperations) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionOperations) |
| # * [Zonal](/compute/docs/reference/rest/alpha/zoneOperations) |
| # |
| # You can use an operation resource to manage asynchronous API requests. |
| # For more information, readHandling |
| # API responses. |
| # |
| # Operations can be global, regional or zonal. |
| # |
| # - For global operations, use the `globalOperations` |
| # resource. |
| # - For regional operations, use the |
| # `regionOperations` resource. |
| # - For zonal operations, use |
| # the `zoneOperations` resource. |
| # |
| # |
| # |
| # For more information, read |
| # Global, Regional, and Zonal Resources. |
| # |
| # Note that completed Operation resources have a limited |
| # retention period. |
| "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. |
| # Not present otherwise. |
| "creationTimestamp": "A String", # [Deprecated] This field is deprecated. |
| "description": "A String", # [Output Only] A textual description of the operation, which is |
| # set when the operation is created. |
| "endTime": "A String", # [Output Only] The time that this operation was completed. This value is inRFC3339 |
| # text format. |
| "error": { # [Output Only] If errors are generated during processing of the operation, |
| # this field will be populated. |
| "errors": [ # [Output Only] The array of errors encountered while processing this |
| # operation. |
| { |
| "code": "A String", # [Output Only] The error type identifier for this error. |
| "errorDetails": [ # [Output Only] An optional list of messages that contain the error |
| # details. There is a set of defined message types to use for providing |
| # details.The syntax depends on the error code. For example, |
| # QuotaExceededInfo will have details when the error code is |
| # QUOTA_EXCEEDED. |
| { |
| "errorInfo": { # Describes the cause of the error with structured details. |
| # |
| # Example of an error when contacting the "pubsub.googleapis.com" API when it |
| # is not enabled: |
| # |
| # { "reason": "API_DISABLED" |
| # "domain": "googleapis.com" |
| # "metadata": { |
| # "resource": "projects/123", |
| # "service": "pubsub.googleapis.com" |
| # } |
| # } |
| # |
| # This response indicates that the pubsub.googleapis.com API is not enabled. |
| # |
| # Example of an error that is returned when attempting to create a Spanner |
| # instance in a region that is out of stock: |
| # |
| # { "reason": "STOCKOUT" |
| # "domain": "spanner.googleapis.com", |
| # "metadata": { |
| # "availableRegions": "us-central1,us-east2" |
| # } |
| # } |
| "domain": "A String", # The logical grouping to which the "reason" belongs. The error domain |
| # is typically the registered service name of the tool or product that |
| # generates the error. Example: "pubsub.googleapis.com". If the error is |
| # generated by some common infrastructure, the error domain must be a |
| # globally unique value that identifies the infrastructure. For Google API |
| # infrastructure, the error domain is "googleapis.com". |
| "metadatas": { # Additional structured details about this error. |
| # |
| # Keys must match a regular expression of `a-z+` but should |
| # ideally be lowerCamelCase. Also, they must be limited to 64 characters in |
| # length. When identifying the current value of an exceeded limit, the units |
| # should be contained in the key, not the value. For example, rather than |
| # `{"instanceLimit": "100/request"}`, should be returned as, |
| # `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| # instances that can be created in a single (batch) request. |
| "a_key": "A String", |
| }, |
| "reason": "A String", # The reason of the error. This is a constant value that identifies the |
| # proximate cause of the error. Error reasons are unique within a particular |
| # domain of errors. This should be at most 63 characters and match a |
| # regular expression of `A-Z+[A-Z0-9]`, which represents |
| # UPPER_SNAKE_CASE. |
| }, |
| "help": { # Provides links to documentation or for performing an out of band action. |
| # |
| # For example, if a quota check failed with an error indicating the calling |
| # project hasn't enabled the accessed service, this can contain a URL pointing |
| # directly to the right place in the developer console to flip the bit. |
| "links": [ # URL(s) pointing to additional information on handling the current error. |
| { # Describes a URL link. |
| "description": "A String", # Describes what the link offers. |
| "url": "A String", # The URL of the link. |
| }, |
| ], |
| }, |
| "localizedMessage": { # Provides a localized error message that is safe to return to the user |
| # which can be attached to an RPC error. |
| "locale": "A String", # The locale used following the specification defined at |
| # https://www.rfc-editor.org/rfc/bcp/bcp47.txt. |
| # Examples are: "en-US", "fr-CH", "es-MX" |
| "message": "A String", # The localized error message in the above locale. |
| }, |
| "quotaInfo": { # Additional details for quota exceeded error for resource quota. |
| "dimensions": { # The map holding related quota dimensions. |
| "a_key": "A String", |
| }, |
| "futureLimit": 3.14, # Future quota limit being rolled out. The limit's unit depends on the quota |
| # type or metric. |
| "limit": 3.14, # Current effective quota limit. The limit's unit depends on the quota type |
| # or metric. |
| "limitName": "A String", # The name of the quota limit. |
| "metricName": "A String", # The Compute Engine quota metric name. |
| "rolloutStatus": "A String", # Rollout status of the future quota limit. |
| }, |
| }, |
| ], |
| "location": "A String", # [Output Only] Indicates the field in the request that caused the error. |
| # This property is optional. |
| "message": "A String", # [Output Only] An optional, human-readable error message. |
| }, |
| ], |
| }, |
| "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error |
| # message that was returned, such as `NOT FOUND`. |
| "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error |
| # status code that was returned. For example, a `404` means the |
| # resource was not found. |
| "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is |
| # defined by the server. |
| "insertTime": "A String", # [Output Only] The time that this operation was requested. |
| # This value is inRFC3339 |
| # text format. |
| "instancesBulkInsertOperationMetadata": { |
| "perLocationStatus": { # Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "createdVmCount": 42, # [Output Only] Count of VMs successfully created so far. |
| "deletedVmCount": 42, # [Output Only] Count of VMs that got deleted during rollback. |
| "failedToCreateVmCount": 42, # [Output Only] Count of VMs that started creating but encountered an |
| # error. |
| "status": "A String", # [Output Only] Creation status of BulkInsert operation - information |
| # if the flow is rolling forward or rolling back. |
| "targetVmCount": 42, # [Output Only] Count of VMs originally planned to be created. |
| }, |
| }, |
| }, |
| "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for |
| # Operation resources. |
| "name": "A String", # [Output Only] Name of the operation. |
| "operationGroupId": "A String", # [Output Only] An ID that represents a group of operations, such as when a |
| # group of operations results from a `bulkInsert` API request. |
| "operationType": "A String", # [Output Only] The type of operation, such as `insert`, |
| # `update`, or `delete`, and so on. |
| "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. |
| # There is no requirement that this be linear or support any granularity of |
| # operations. This should not be used to guess when the operation will be |
| # complete. This number should monotonically increase as the operation |
| # progresses. |
| "region": "A String", # [Output Only] The URL of the region where the operation resides. Only |
| # applicable when performing regional operations. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. |
| "setCommonInstanceMetadataOperationMetadata": { # [Output Only] If the operation is for projects.setCommonInstanceMetadata, |
| # this field will contain information on all underlying zonal actions and |
| # their state. |
| "clientOperationId": "A String", # [Output Only] The client operation id. |
| "perLocationOperations": { # [Output Only] Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "error": { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is |
| # populated. |
| # different programming environments, including REST APIs and RPC APIs. It is |
| # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| # three pieces of data: error code, error message, and error details. |
| # |
| # You can find out more about this error model and how to work with it in the |
| # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| "details": [ # A list of messages that carry the error details. There is a common set of |
| # message types for APIs to use. |
| { |
| "a_key": "", # Properties of the object. Contains field @type with type URL. |
| }, |
| ], |
| "message": "A String", # A developer-facing error message, which should be in English. Any |
| # user-facing error message should be localized and sent in the |
| # google.rpc.Status.details field, or localized by the client. |
| }, |
| "state": "A String", # [Output Only] Status of the action, which can be one of the following: |
| # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. |
| }, |
| }, |
| }, |
| "startTime": "A String", # [Output Only] The time that this operation was started by the server. |
| # This value is inRFC3339 |
| # text format. |
| "status": "A String", # [Output Only] The status of the operation, which can be one of the |
| # following: |
| # `PENDING`, `RUNNING`, or `DONE`. |
| "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the |
| # operation. |
| "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation |
| # of the target resource. |
| "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For |
| # operations related to creating a snapshot, this points to the disk |
| # that the snapshot was created from. |
| "user": "A String", # [Output Only] User who requested the operation, for example: |
| # `[email protected]` or |
| # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. |
| "warnings": [ # [Output Only] If warning messages are generated during processing of the |
| # operation, this field will be populated. |
| { |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| ], |
| "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only |
| # applicable when performing per-zone operations. |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="invalidateCache">invalidateCache(project, urlMap, body=None, requestId=None, x__xgafv=None)</code> |
| <pre>Initiates a cache invalidation operation, invalidating the specified path, |
| scoped to the specified UrlMap. |
| |
| For more information, see [Invalidating cached |
| content](/cdn/docs/invalidating-cached-content). |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| urlMap: string, Name of the UrlMap scoping this request. (required) |
| body: object, The request body. |
| The object takes the form of: |
| |
| { |
| "cacheTags": [ # A list of cache tags used to identify cached objects. |
| # |
| # |
| # - Cache tags are specified when the response is first cached, by setting |
| # the `Cache-Tag` response header at the origin. |
| # - Multiple cache tags in the same invalidation request are treated as |
| # Boolean `OR` - for example, `tag1 OR tag2 OR tag3`. |
| # - If other fields are also specified, these are treated as Boolean `AND` |
| # with any tags. |
| # |
| # |
| # Up to 10 tags can be specified in a single invalidation request. |
| "A String", |
| ], |
| "host": "A String", # If set, this invalidation rule will only apply to requests with a Host |
| # header matching host. |
| "path": "A String", |
| } |
| |
| requestId: string, An optional request ID to identify requests. Specify a unique request ID so |
| that if you must retry your request, the server will know to ignore the |
| request if it has already been completed. |
| |
| For example, consider a situation where you make an initial request and |
| the request times out. If you make the request again with the same |
| request ID, the server can check if original operation with the same |
| request ID was received, and if so, will ignore the second request. This |
| prevents clients from accidentally creating duplicate commitments. |
| |
| The request ID must be |
| a valid UUID with the exception that zero UUID is not supported |
| (00000000-0000-0000-0000-000000000000). |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # Represents an Operation resource. |
| # |
| # Google Compute Engine has three Operation resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/globalOperations) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionOperations) |
| # * [Zonal](/compute/docs/reference/rest/alpha/zoneOperations) |
| # |
| # You can use an operation resource to manage asynchronous API requests. |
| # For more information, readHandling |
| # API responses. |
| # |
| # Operations can be global, regional or zonal. |
| # |
| # - For global operations, use the `globalOperations` |
| # resource. |
| # - For regional operations, use the |
| # `regionOperations` resource. |
| # - For zonal operations, use |
| # the `zoneOperations` resource. |
| # |
| # |
| # |
| # For more information, read |
| # Global, Regional, and Zonal Resources. |
| # |
| # Note that completed Operation resources have a limited |
| # retention period. |
| "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. |
| # Not present otherwise. |
| "creationTimestamp": "A String", # [Deprecated] This field is deprecated. |
| "description": "A String", # [Output Only] A textual description of the operation, which is |
| # set when the operation is created. |
| "endTime": "A String", # [Output Only] The time that this operation was completed. This value is inRFC3339 |
| # text format. |
| "error": { # [Output Only] If errors are generated during processing of the operation, |
| # this field will be populated. |
| "errors": [ # [Output Only] The array of errors encountered while processing this |
| # operation. |
| { |
| "code": "A String", # [Output Only] The error type identifier for this error. |
| "errorDetails": [ # [Output Only] An optional list of messages that contain the error |
| # details. There is a set of defined message types to use for providing |
| # details.The syntax depends on the error code. For example, |
| # QuotaExceededInfo will have details when the error code is |
| # QUOTA_EXCEEDED. |
| { |
| "errorInfo": { # Describes the cause of the error with structured details. |
| # |
| # Example of an error when contacting the "pubsub.googleapis.com" API when it |
| # is not enabled: |
| # |
| # { "reason": "API_DISABLED" |
| # "domain": "googleapis.com" |
| # "metadata": { |
| # "resource": "projects/123", |
| # "service": "pubsub.googleapis.com" |
| # } |
| # } |
| # |
| # This response indicates that the pubsub.googleapis.com API is not enabled. |
| # |
| # Example of an error that is returned when attempting to create a Spanner |
| # instance in a region that is out of stock: |
| # |
| # { "reason": "STOCKOUT" |
| # "domain": "spanner.googleapis.com", |
| # "metadata": { |
| # "availableRegions": "us-central1,us-east2" |
| # } |
| # } |
| "domain": "A String", # The logical grouping to which the "reason" belongs. The error domain |
| # is typically the registered service name of the tool or product that |
| # generates the error. Example: "pubsub.googleapis.com". If the error is |
| # generated by some common infrastructure, the error domain must be a |
| # globally unique value that identifies the infrastructure. For Google API |
| # infrastructure, the error domain is "googleapis.com". |
| "metadatas": { # Additional structured details about this error. |
| # |
| # Keys must match a regular expression of `a-z+` but should |
| # ideally be lowerCamelCase. Also, they must be limited to 64 characters in |
| # length. When identifying the current value of an exceeded limit, the units |
| # should be contained in the key, not the value. For example, rather than |
| # `{"instanceLimit": "100/request"}`, should be returned as, |
| # `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| # instances that can be created in a single (batch) request. |
| "a_key": "A String", |
| }, |
| "reason": "A String", # The reason of the error. This is a constant value that identifies the |
| # proximate cause of the error. Error reasons are unique within a particular |
| # domain of errors. This should be at most 63 characters and match a |
| # regular expression of `A-Z+[A-Z0-9]`, which represents |
| # UPPER_SNAKE_CASE. |
| }, |
| "help": { # Provides links to documentation or for performing an out of band action. |
| # |
| # For example, if a quota check failed with an error indicating the calling |
| # project hasn't enabled the accessed service, this can contain a URL pointing |
| # directly to the right place in the developer console to flip the bit. |
| "links": [ # URL(s) pointing to additional information on handling the current error. |
| { # Describes a URL link. |
| "description": "A String", # Describes what the link offers. |
| "url": "A String", # The URL of the link. |
| }, |
| ], |
| }, |
| "localizedMessage": { # Provides a localized error message that is safe to return to the user |
| # which can be attached to an RPC error. |
| "locale": "A String", # The locale used following the specification defined at |
| # https://www.rfc-editor.org/rfc/bcp/bcp47.txt. |
| # Examples are: "en-US", "fr-CH", "es-MX" |
| "message": "A String", # The localized error message in the above locale. |
| }, |
| "quotaInfo": { # Additional details for quota exceeded error for resource quota. |
| "dimensions": { # The map holding related quota dimensions. |
| "a_key": "A String", |
| }, |
| "futureLimit": 3.14, # Future quota limit being rolled out. The limit's unit depends on the quota |
| # type or metric. |
| "limit": 3.14, # Current effective quota limit. The limit's unit depends on the quota type |
| # or metric. |
| "limitName": "A String", # The name of the quota limit. |
| "metricName": "A String", # The Compute Engine quota metric name. |
| "rolloutStatus": "A String", # Rollout status of the future quota limit. |
| }, |
| }, |
| ], |
| "location": "A String", # [Output Only] Indicates the field in the request that caused the error. |
| # This property is optional. |
| "message": "A String", # [Output Only] An optional, human-readable error message. |
| }, |
| ], |
| }, |
| "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error |
| # message that was returned, such as `NOT FOUND`. |
| "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error |
| # status code that was returned. For example, a `404` means the |
| # resource was not found. |
| "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is |
| # defined by the server. |
| "insertTime": "A String", # [Output Only] The time that this operation was requested. |
| # This value is inRFC3339 |
| # text format. |
| "instancesBulkInsertOperationMetadata": { |
| "perLocationStatus": { # Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "createdVmCount": 42, # [Output Only] Count of VMs successfully created so far. |
| "deletedVmCount": 42, # [Output Only] Count of VMs that got deleted during rollback. |
| "failedToCreateVmCount": 42, # [Output Only] Count of VMs that started creating but encountered an |
| # error. |
| "status": "A String", # [Output Only] Creation status of BulkInsert operation - information |
| # if the flow is rolling forward or rolling back. |
| "targetVmCount": 42, # [Output Only] Count of VMs originally planned to be created. |
| }, |
| }, |
| }, |
| "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for |
| # Operation resources. |
| "name": "A String", # [Output Only] Name of the operation. |
| "operationGroupId": "A String", # [Output Only] An ID that represents a group of operations, such as when a |
| # group of operations results from a `bulkInsert` API request. |
| "operationType": "A String", # [Output Only] The type of operation, such as `insert`, |
| # `update`, or `delete`, and so on. |
| "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. |
| # There is no requirement that this be linear or support any granularity of |
| # operations. This should not be used to guess when the operation will be |
| # complete. This number should monotonically increase as the operation |
| # progresses. |
| "region": "A String", # [Output Only] The URL of the region where the operation resides. Only |
| # applicable when performing regional operations. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. |
| "setCommonInstanceMetadataOperationMetadata": { # [Output Only] If the operation is for projects.setCommonInstanceMetadata, |
| # this field will contain information on all underlying zonal actions and |
| # their state. |
| "clientOperationId": "A String", # [Output Only] The client operation id. |
| "perLocationOperations": { # [Output Only] Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "error": { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is |
| # populated. |
| # different programming environments, including REST APIs and RPC APIs. It is |
| # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| # three pieces of data: error code, error message, and error details. |
| # |
| # You can find out more about this error model and how to work with it in the |
| # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| "details": [ # A list of messages that carry the error details. There is a common set of |
| # message types for APIs to use. |
| { |
| "a_key": "", # Properties of the object. Contains field @type with type URL. |
| }, |
| ], |
| "message": "A String", # A developer-facing error message, which should be in English. Any |
| # user-facing error message should be localized and sent in the |
| # google.rpc.Status.details field, or localized by the client. |
| }, |
| "state": "A String", # [Output Only] Status of the action, which can be one of the following: |
| # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. |
| }, |
| }, |
| }, |
| "startTime": "A String", # [Output Only] The time that this operation was started by the server. |
| # This value is inRFC3339 |
| # text format. |
| "status": "A String", # [Output Only] The status of the operation, which can be one of the |
| # following: |
| # `PENDING`, `RUNNING`, or `DONE`. |
| "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the |
| # operation. |
| "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation |
| # of the target resource. |
| "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For |
| # operations related to creating a snapshot, this points to the disk |
| # that the snapshot was created from. |
| "user": "A String", # [Output Only] User who requested the operation, for example: |
| # `[email protected]` or |
| # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. |
| "warnings": [ # [Output Only] If warning messages are generated during processing of the |
| # operation, this field will be populated. |
| { |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| ], |
| "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only |
| # applicable when performing per-zone operations. |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="list">list(project, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None, x__xgafv=None)</code> |
| <pre>Retrieves the list of UrlMap resources available to the specified |
| project. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| filter: string, A filter expression that filters resources listed in the response. Most |
| Compute resources support two types of filter expressions: |
| expressions that support regular expressions and expressions that follow |
| API improvement proposal AIP-160. |
| These two types of filter expressions cannot be mixed in one request. |
| |
| If you want to use AIP-160, your expression must specify the field name, an |
| operator, and the value that you want to use for filtering. The value |
| must be a string, a number, or a boolean. The operator |
| must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. |
| |
| For example, if you are filtering Compute Engine instances, you can |
| exclude instances named `example-instance` by specifying |
| `name != example-instance`. |
| |
| The `:*` comparison can be used to test whether a key has been defined. |
| For example, to find all objects with `owner` label use: |
| ``` |
| labels.owner:* |
| ``` |
| |
| You can also filter nested fields. For example, you could specify |
| `scheduling.automaticRestart = false` to include instances only |
| if they are not scheduled for automatic restarts. You can use filtering |
| on nested fields to filter based onresource labels. |
| |
| To filter on multiple expressions, provide each separate expression within |
| parentheses. For example: |
| ``` |
| (scheduling.automaticRestart = true) |
| (cpuPlatform = "Intel Skylake") |
| ``` |
| By default, each expression is an `AND` expression. However, you |
| can include `AND` and `OR` expressions explicitly. |
| For example: |
| ``` |
| (cpuPlatform = "Intel Skylake") OR |
| (cpuPlatform = "Intel Broadwell") AND |
| (scheduling.automaticRestart = true) |
| ``` |
| |
| If you want to use a regular expression, use the `eq` (equal) or `ne` |
| (not equal) operator against a single un-parenthesized expression with or |
| without quotes or against multiple parenthesized expressions. Examples: |
| |
| `fieldname eq unquoted literal` |
| `fieldname eq 'single quoted literal'` |
| `fieldname eq "double quoted literal"` |
| `(fieldname1 eq literal) (fieldname2 ne "literal")` |
| |
| The literal value is interpreted as a regular expression using GoogleRE2 library syntax. |
| The literal value must match the entire field. |
| |
| For example, to filter for instances that do not end with name "instance", |
| you would use `name ne .*instance`. |
| |
| You cannot combine constraints on multiple fields using regular |
| expressions. |
| maxResults: integer, The maximum number of results per page that should be returned. |
| If the number of available results is larger than `maxResults`, |
| Compute Engine returns a `nextPageToken` that can be used to get |
| the next page of results in subsequent list requests. Acceptable values are |
| `0` to `500`, inclusive. (Default: `500`) |
| orderBy: string, Sorts list results by a certain order. By default, results |
| are returned in alphanumerical order based on the resource name. |
| |
| You can also sort results in descending order based on the creation |
| timestamp using `orderBy="creationTimestamp desc"`. This sorts |
| results based on the `creationTimestamp` field in |
| reverse chronological order (newest result first). Use this to sort |
| resources like operations so that the newest operation is returned first. |
| |
| Currently, only sorting by `name` or |
| `creationTimestamp desc` is supported. |
| pageToken: string, Specifies a page token to use. Set `pageToken` to the |
| `nextPageToken` returned by a previous list request to get |
| the next page of results. |
| returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case |
| of failure. The default value is false. |
| |
| For example, when partial success behavior is enabled, aggregatedList for a |
| single zone scope either returns all resources in the zone or no resources, |
| with an error code. |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # Contains a list of UrlMap resources. |
| "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. |
| "items": [ # A list of UrlMap resources. |
| { # Represents a URL Map resource. |
| # |
| # Compute Engine has two URL Map resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/urlMaps) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionUrlMaps) |
| # |
| # 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 aloadBalancingScheme of INTERNAL_MANAGED. For more |
| # information, read URL |
| # Map Concepts. |
| "creationTimestamp": "A String", # [Output Only] Creation timestamp inRFC3339 |
| # text format. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket 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: |
| # |
| # |
| # - defaultCustomErrorResponsePolicy containing policies for |
| # responding to 5xx and 4xx errors |
| # - A PathMatcher configured for *.example.com has |
| # defaultCustomErrorResponsePolicy for 4xx. |
| # |
| # If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. |
| # When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When |
| # a request that does not match any host in *.example.com such |
| # as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only |
| # once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # hostRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within defaultRouteAction. |
| # |
| # |
| # defaultRouteAction has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL of the defaultService resource to |
| # which traffic is directed if none of the hostRules match. |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # defaultService has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request |
| # is redirected to a URL specified by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "fingerprint": "A String", # 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 UrlMap. An up-to-date fingerprint must be provided |
| # in order to update the UrlMap, otherwise the request will |
| # fail with error 412 conditionNotMet. |
| # |
| # To see the latest fingerprint, make a get() request to |
| # retrieve a UrlMap. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction specified here take effect afterheaderAction specified under pathMatcher. |
| # |
| # headerAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "hostRules": [ # The list of host rules to use against the URL. |
| { # UrlMaps |
| # A host-matching rule for a URL. If matched, will use the namedPathMatcher to select the BackendService. |
| "description": "A String", # 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 host:port.* matches any string of ([a-z0-9-.]*). 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 validateForProxyless field |
| # set to true. |
| "A String", |
| ], |
| "pathMatcher": "A String", # The name of the PathMatcher to use to match the path portion |
| # of the URL if the hostRule matches the URL's host portion. |
| }, |
| ], |
| "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is |
| # defined by the server. |
| "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for |
| # url maps. |
| "name": "A String", # Name of the resource. Provided by the client when the resource is created. |
| # The name must be 1-63 characters long, and comply withRFC1035. |
| # Specifically, the name must be 1-63 characters long and match the regular |
| # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first |
| # character must be a lowercase letter, and all following characters must |
| # be a dash, lowercase letter, or digit, except the last character, which |
| # cannot be a dash. |
| "pathMatchers": [ # The list of named PathMatchers to use against the URL. |
| { # 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. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # This policy takes |
| # effect at the PathMatcher level and applies only when no |
| # policy has been defined for the error code at lower levels likeRouteRule and PathRule within thisPathMatcher. If an error code does not have a policy defined |
| # in defaultCustomErrorResponsePolicy, then a policy defined for |
| # the error code in UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # For example, consider a UrlMap with the following |
| # configuration: |
| # |
| # |
| # - UrlMap.defaultCustomErrorResponsePolicy is configured |
| # with policies for 5xx and 4xx errors |
| # - A RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withpathMatcher.defaultRouteAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # pathRules or routeRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path matcher'sdefaultRouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL to the BackendService resource. This |
| # URL is used if none of the pathRules orrouteRules defined by this PathMatcher are |
| # matched. For example, the |
| # following are all valid URLs to a BackendService resource: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService |
| # - compute/v1/projects/project/global/backendServices/backendService |
| # - global/backendServices/backendService |
| # |
| # |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Authorization requires one or more of the following Google IAM permissions on the |
| # specified resource default_service: |
| # |
| # |
| # - compute.backendBuckets.use |
| # - compute.backendServices.use |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified pathRules orrouteRules match, the request is redirected to a URL specified |
| # by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backend service. |
| # |
| # HeaderAction specified here are applied after the matchingHttpRouteRule HeaderAction and before theHeaderAction in the UrlMap |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "name": "A String", # The name to which this PathMatcher is referred by theHostRule. |
| "pathRules": [ # The list of path rules. Use this list instead of routeRules |
| # 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 pathRule 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 pathMatcher, only one ofpathRules or routeRules must be set. |
| { # A path-matching rule for a URL. If matched, will use the specifiedBackendService to handle the traffic arriving at this URL. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the PathRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.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 atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "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. |
| "A String", |
| ], |
| "routeAction": { # 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When a path pattern is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| "routeRules": [ # The list of HTTP route rules. Use this list instead ofpathRules when advanced route matching and routing actions are |
| # desired. routeRules are evaluated in order of priority, from |
| # the lowest to highest number. |
| # |
| # Within a given pathMatcher, you can set only one ofpathRules or routeRules. |
| { # The HttpRouteRule setting specifies how to match an HTTP request |
| # and the corresponding routing action that load balancing proxies perform. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the RouteRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withrouteRules.routeAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thecustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the customErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "description": "A String", # The short description conveying the intent of this routeRule. |
| # |
| # |
| # The description can have a maximum length of 1024 characters. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction value specified here is applied before the |
| # matching pathMatchers[].headerAction and afterpathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "httpFilterConfigs": [ # Outbound route specific configuration fornetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterConfigs only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "httpFilterMetadata": [ # Outbound route specific metadata supplied tonetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterMetadata only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # The only configTypeUrl supported istype.googleapis.com/google.protobuf.Struct |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "matchRules": [ # The list of criteria for matching attributes of a request to thisrouteRule. This list has OR semantics: the request matches |
| # this routeRule when any of thematchRules are satisfied. However predicates within |
| # a given matchRule have AND semantics. All predicates |
| # within a matchRule must match for the request to |
| # match the rule. |
| { # HttpRouteRuleMatch specifies a set of criteria for matching |
| # requests to an HttpRouteRule. All specified criteria must |
| # be satisfied for a match to occur. |
| "fullPathMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must exactly match the value specified infullPathMatch after removing any query parameters and anchor |
| # that may be part of the original URL. |
| # |
| # fullPathMatch must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "headerMatches": [ # Specifies a list of header match criteria, all of which must match |
| # corresponding headers in the request. |
| { # matchRule criteria for request header matches. |
| "exactMatch": "A String", # The value should exactly match contents of exactMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "headerName": "A String", # 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 validateForProxyless field set to true, only |
| # non-binary |
| # user-specified custom metadata and the `content-type` header are supported. |
| # The following transport-level headers cannot be used in header matching |
| # rules: |
| # `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, |
| # `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, |
| # `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, |
| # `grpc-timeout` and `grpc-trace-bin`. |
| "invertMatch": True or False, # If set to false, the headerMatch is considered a |
| # match if the preceding match criteria are met. If set to true, |
| # the headerMatch is considered a match if the preceding |
| # match criteria are NOT met. |
| # |
| # The default setting is false. |
| "prefixMatch": "A String", # The value of the header must start with the contents ofprefixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "presentMatch": True or False, # A header with the contents of headerName must exist. The |
| # match takes place whether or not the request's header has a value. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay # The header value must be an integer and its value must be in the range |
| # specified in rangeMatch. If the header does not contain an |
| # integer, number or is empty, the match fails. |
| # |
| # For example for a range [-5, 0] |
| # |
| # |
| # - -3 will match. |
| # - 0 will not match. |
| # - 0.25 will not match. |
| # - -3someString will not match. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # rangeMatch is not supported for load balancers |
| # that have loadBalancingScheme set to EXTERNAL. |
| # within the specified integer range. |
| "rangeEnd": "A String", # The end of the range (exclusive) in signed long integer format. |
| "rangeStart": "A String", # The start of the range (inclusive) in signed long integer format. |
| }, |
| "regexMatch": "A String", # The value of the header must match the regular expression specified inregexMatch. |
| # 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 exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "suffixMatch": "A String", # The value of the header must end with the contents ofsuffixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| }, |
| ], |
| "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch |
| # 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. |
| "metadataFilters": [ # 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 metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels 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. |
| # |
| # metadataFilters specified here is applied after those |
| # specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to. |
| # |
| # metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Opaque filter criteria used by load balancers to restrict routing |
| # configuration to a limited set of load balancing proxies. Proxies and |
| # sidecars involved in load balancing would typically present metadata to the |
| # load balancers that need to match criteria specified here. If a match takes |
| # place, the relevant configuration is made available to those |
| # proxies. |
| # |
| # For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least |
| # one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels must match with |
| # corresponding labels provided in the metadata. |
| # |
| # An example for using metadataFilters would be: if |
| # load balancing involves |
| # Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers. |
| "filterLabels": [ # The list of label value pairs that must match labels in the provided |
| # metadata based on filterMatchCriteria |
| # |
| # This list must not be empty and can have at the most 64 entries. |
| { # MetadataFilter label name value pairs that are expected |
| # to match corresponding labels presented as metadata to the load balancer. |
| "name": "A String", # Name of metadata label. |
| # |
| # The name can have a maximum length of 1024 characters and must be at |
| # least 1 character long. |
| "value": "A String", # The value of the label must match the specified value. |
| # |
| # value can have a maximum length of 1024 characters. |
| }, |
| ], |
| "filterMatchCriteria": "A String", # Specifies how individual filter label matches |
| # within the list of filterLabels and contributes toward the |
| # overall metadataFilter match. |
| # |
| # Supported values are: |
| # |
| # - MATCH_ANY: at least one of the filterLabels |
| # must have a matching label in the provided metadata. |
| # - MATCH_ALL: all filterLabels must have |
| # matching labels in the provided metadata. |
| }, |
| ], |
| "pathTemplateMatch": "A String", # 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 |
| # |
| # |
| # - The value must be between 1 and 1024 characters |
| # - The pattern must start with a leading slash ("/") |
| # - There may be no more than 5 operators in pattern |
| # |
| # Precisely one ofprefix_match, full_path_match,regex_match or path_template_match must be set. |
| "prefixMatch": "A String", # For satisfying the matchRule condition, the request's |
| # path must begin with the specified prefixMatch.prefixMatch must begin with a /. |
| # |
| # The value must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "queryParameterMatches": [ # 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. |
| { # HttpRouteRuleMatch criteria for a request's query parameter. |
| "exactMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter exactly matches the contents of exactMatch. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "name": "A String", # The name of the query parameter to match. The query parameter must exist in |
| # the request, in the absence of which the request match fails. |
| "presentMatch": True or False, # Specifies that the queryParameterMatch matches if the |
| # request contains the query parameter, irrespective of whether the |
| # parameter has a value or not. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "regexMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter matches the regular expression specified byregexMatch. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "regexMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor |
| # supplied with the original URL. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of prefixMatch, fullPathMatch orregexMatch must be |
| # specified. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "priority": 42, # For routeRules within a given pathMatcher, |
| # priority determines the order in which a load balancer interpretsrouteRules. RouteRules 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. |
| "routeAction": { # In response to a matching matchRule, 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a route rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| }, |
| ], |
| "region": "A String", # [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. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "tests": [ # The list of expected URL mapping tests. Request to update theUrlMap succeeds only if all test cases pass. You can specify a |
| # maximum of 100 tests per UrlMap. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Message for the expected URL mappings. |
| "backendServiceWeight": 42, # The weight to use for the supplied host and path when using advanced |
| # routing rules that involve traffic splitting. |
| "description": "A String", # Description of this test case. |
| "expectedOutputUrl": "A String", # 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 whenexpectedOutputUrl matches the request forwarded by |
| # the load balancer to backends. For rules with urlRewrite, |
| # the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored. |
| # |
| # For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer's |
| # redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. |
| # If urlRedirect specifies strip_query, the test |
| # passes only if expectedOutputUrl does not contain any query |
| # parameters. |
| # |
| # expectedOutputUrl is optional whenservice is specified. |
| "expectedRedirectResponseCode": 42, # For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in |
| # load balancer's redirect response. |
| # |
| # expectedRedirectResponseCode cannot be set whenservice is set. |
| "expectedUrlRedirect": "A String", # The expected URL that should be redirected to for the host and path |
| # being tested. |
| # [Deprecated] This field is deprecated. |
| # Use expected_output_url instead. |
| "headers": [ # HTTP headers for this request. If headers contains |
| # a host header, then host must also match the header value. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. If headers contains a host header, |
| # then host must also match the header value. |
| "path": "A String", # Path portion of the URL. |
| "service": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| # |
| # The service field cannot |
| # be set if expectedRedirectResponseCode is set. |
| }, |
| ], |
| }, |
| ], |
| "kind": "compute#urlMapList", # Type of resource. |
| "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for |
| # list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for |
| # the query parameter pageToken in the next list request. |
| # Subsequent list requests will have their own nextPageToken to |
| # continue paging through the results. |
| "selfLink": "A String", # [Output Only] Server-defined URL for this resource. |
| "warning": { # [Output Only] Informational warning message. |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="list_next">list_next()</code> |
| <pre>Retrieves the next page of results. |
| |
| Args: |
| previous_request: The request for the previous page. (required) |
| previous_response: The response from the request for the previous page. (required) |
| |
| Returns: |
| A request object that you can call 'execute()' on to request the next |
| page. Returns None if there are no more items in the collection. |
| </pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="patch">patch(project, urlMap, body=None, requestId=None, x__xgafv=None)</code> |
| <pre>Patches the specified UrlMap resource with the data included in the |
| request. This method supportsPATCH |
| semantics and uses theJSON merge |
| patch format and processing rules. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| urlMap: string, Name of the UrlMap resource to patch. (required) |
| body: object, The request body. |
| The object takes the form of: |
| |
| { # Represents a URL Map resource. |
| # |
| # Compute Engine has two URL Map resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/urlMaps) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionUrlMaps) |
| # |
| # 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 aloadBalancingScheme of INTERNAL_MANAGED. For more |
| # information, read URL |
| # Map Concepts. |
| "creationTimestamp": "A String", # [Output Only] Creation timestamp inRFC3339 |
| # text format. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket 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: |
| # |
| # |
| # - defaultCustomErrorResponsePolicy containing policies for |
| # responding to 5xx and 4xx errors |
| # - A PathMatcher configured for *.example.com has |
| # defaultCustomErrorResponsePolicy for 4xx. |
| # |
| # If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. |
| # When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When |
| # a request that does not match any host in *.example.com such |
| # as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only |
| # once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # hostRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within defaultRouteAction. |
| # |
| # |
| # defaultRouteAction has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL of the defaultService resource to |
| # which traffic is directed if none of the hostRules match. |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # defaultService has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request |
| # is redirected to a URL specified by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "fingerprint": "A String", # 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 UrlMap. An up-to-date fingerprint must be provided |
| # in order to update the UrlMap, otherwise the request will |
| # fail with error 412 conditionNotMet. |
| # |
| # To see the latest fingerprint, make a get() request to |
| # retrieve a UrlMap. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction specified here take effect afterheaderAction specified under pathMatcher. |
| # |
| # headerAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "hostRules": [ # The list of host rules to use against the URL. |
| { # UrlMaps |
| # A host-matching rule for a URL. If matched, will use the namedPathMatcher to select the BackendService. |
| "description": "A String", # 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 host:port.* matches any string of ([a-z0-9-.]*). 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 validateForProxyless field |
| # set to true. |
| "A String", |
| ], |
| "pathMatcher": "A String", # The name of the PathMatcher to use to match the path portion |
| # of the URL if the hostRule matches the URL's host portion. |
| }, |
| ], |
| "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is |
| # defined by the server. |
| "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for |
| # url maps. |
| "name": "A String", # Name of the resource. Provided by the client when the resource is created. |
| # The name must be 1-63 characters long, and comply withRFC1035. |
| # Specifically, the name must be 1-63 characters long and match the regular |
| # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first |
| # character must be a lowercase letter, and all following characters must |
| # be a dash, lowercase letter, or digit, except the last character, which |
| # cannot be a dash. |
| "pathMatchers": [ # The list of named PathMatchers to use against the URL. |
| { # 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. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # This policy takes |
| # effect at the PathMatcher level and applies only when no |
| # policy has been defined for the error code at lower levels likeRouteRule and PathRule within thisPathMatcher. If an error code does not have a policy defined |
| # in defaultCustomErrorResponsePolicy, then a policy defined for |
| # the error code in UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # For example, consider a UrlMap with the following |
| # configuration: |
| # |
| # |
| # - UrlMap.defaultCustomErrorResponsePolicy is configured |
| # with policies for 5xx and 4xx errors |
| # - A RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withpathMatcher.defaultRouteAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # pathRules or routeRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path matcher'sdefaultRouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL to the BackendService resource. This |
| # URL is used if none of the pathRules orrouteRules defined by this PathMatcher are |
| # matched. For example, the |
| # following are all valid URLs to a BackendService resource: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService |
| # - compute/v1/projects/project/global/backendServices/backendService |
| # - global/backendServices/backendService |
| # |
| # |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Authorization requires one or more of the following Google IAM permissions on the |
| # specified resource default_service: |
| # |
| # |
| # - compute.backendBuckets.use |
| # - compute.backendServices.use |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified pathRules orrouteRules match, the request is redirected to a URL specified |
| # by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backend service. |
| # |
| # HeaderAction specified here are applied after the matchingHttpRouteRule HeaderAction and before theHeaderAction in the UrlMap |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "name": "A String", # The name to which this PathMatcher is referred by theHostRule. |
| "pathRules": [ # The list of path rules. Use this list instead of routeRules |
| # 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 pathRule 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 pathMatcher, only one ofpathRules or routeRules must be set. |
| { # A path-matching rule for a URL. If matched, will use the specifiedBackendService to handle the traffic arriving at this URL. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the PathRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.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 atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "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. |
| "A String", |
| ], |
| "routeAction": { # 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When a path pattern is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| "routeRules": [ # The list of HTTP route rules. Use this list instead ofpathRules when advanced route matching and routing actions are |
| # desired. routeRules are evaluated in order of priority, from |
| # the lowest to highest number. |
| # |
| # Within a given pathMatcher, you can set only one ofpathRules or routeRules. |
| { # The HttpRouteRule setting specifies how to match an HTTP request |
| # and the corresponding routing action that load balancing proxies perform. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the RouteRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withrouteRules.routeAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thecustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the customErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "description": "A String", # The short description conveying the intent of this routeRule. |
| # |
| # |
| # The description can have a maximum length of 1024 characters. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction value specified here is applied before the |
| # matching pathMatchers[].headerAction and afterpathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "httpFilterConfigs": [ # Outbound route specific configuration fornetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterConfigs only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "httpFilterMetadata": [ # Outbound route specific metadata supplied tonetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterMetadata only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # The only configTypeUrl supported istype.googleapis.com/google.protobuf.Struct |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "matchRules": [ # The list of criteria for matching attributes of a request to thisrouteRule. This list has OR semantics: the request matches |
| # this routeRule when any of thematchRules are satisfied. However predicates within |
| # a given matchRule have AND semantics. All predicates |
| # within a matchRule must match for the request to |
| # match the rule. |
| { # HttpRouteRuleMatch specifies a set of criteria for matching |
| # requests to an HttpRouteRule. All specified criteria must |
| # be satisfied for a match to occur. |
| "fullPathMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must exactly match the value specified infullPathMatch after removing any query parameters and anchor |
| # that may be part of the original URL. |
| # |
| # fullPathMatch must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "headerMatches": [ # Specifies a list of header match criteria, all of which must match |
| # corresponding headers in the request. |
| { # matchRule criteria for request header matches. |
| "exactMatch": "A String", # The value should exactly match contents of exactMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "headerName": "A String", # 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 validateForProxyless field set to true, only |
| # non-binary |
| # user-specified custom metadata and the `content-type` header are supported. |
| # The following transport-level headers cannot be used in header matching |
| # rules: |
| # `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, |
| # `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, |
| # `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, |
| # `grpc-timeout` and `grpc-trace-bin`. |
| "invertMatch": True or False, # If set to false, the headerMatch is considered a |
| # match if the preceding match criteria are met. If set to true, |
| # the headerMatch is considered a match if the preceding |
| # match criteria are NOT met. |
| # |
| # The default setting is false. |
| "prefixMatch": "A String", # The value of the header must start with the contents ofprefixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "presentMatch": True or False, # A header with the contents of headerName must exist. The |
| # match takes place whether or not the request's header has a value. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay # The header value must be an integer and its value must be in the range |
| # specified in rangeMatch. If the header does not contain an |
| # integer, number or is empty, the match fails. |
| # |
| # For example for a range [-5, 0] |
| # |
| # |
| # - -3 will match. |
| # - 0 will not match. |
| # - 0.25 will not match. |
| # - -3someString will not match. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # rangeMatch is not supported for load balancers |
| # that have loadBalancingScheme set to EXTERNAL. |
| # within the specified integer range. |
| "rangeEnd": "A String", # The end of the range (exclusive) in signed long integer format. |
| "rangeStart": "A String", # The start of the range (inclusive) in signed long integer format. |
| }, |
| "regexMatch": "A String", # The value of the header must match the regular expression specified inregexMatch. |
| # 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 exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "suffixMatch": "A String", # The value of the header must end with the contents ofsuffixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| }, |
| ], |
| "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch |
| # 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. |
| "metadataFilters": [ # 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 metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels 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. |
| # |
| # metadataFilters specified here is applied after those |
| # specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to. |
| # |
| # metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Opaque filter criteria used by load balancers to restrict routing |
| # configuration to a limited set of load balancing proxies. Proxies and |
| # sidecars involved in load balancing would typically present metadata to the |
| # load balancers that need to match criteria specified here. If a match takes |
| # place, the relevant configuration is made available to those |
| # proxies. |
| # |
| # For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least |
| # one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels must match with |
| # corresponding labels provided in the metadata. |
| # |
| # An example for using metadataFilters would be: if |
| # load balancing involves |
| # Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers. |
| "filterLabels": [ # The list of label value pairs that must match labels in the provided |
| # metadata based on filterMatchCriteria |
| # |
| # This list must not be empty and can have at the most 64 entries. |
| { # MetadataFilter label name value pairs that are expected |
| # to match corresponding labels presented as metadata to the load balancer. |
| "name": "A String", # Name of metadata label. |
| # |
| # The name can have a maximum length of 1024 characters and must be at |
| # least 1 character long. |
| "value": "A String", # The value of the label must match the specified value. |
| # |
| # value can have a maximum length of 1024 characters. |
| }, |
| ], |
| "filterMatchCriteria": "A String", # Specifies how individual filter label matches |
| # within the list of filterLabels and contributes toward the |
| # overall metadataFilter match. |
| # |
| # Supported values are: |
| # |
| # - MATCH_ANY: at least one of the filterLabels |
| # must have a matching label in the provided metadata. |
| # - MATCH_ALL: all filterLabels must have |
| # matching labels in the provided metadata. |
| }, |
| ], |
| "pathTemplateMatch": "A String", # 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 |
| # |
| # |
| # - The value must be between 1 and 1024 characters |
| # - The pattern must start with a leading slash ("/") |
| # - There may be no more than 5 operators in pattern |
| # |
| # Precisely one ofprefix_match, full_path_match,regex_match or path_template_match must be set. |
| "prefixMatch": "A String", # For satisfying the matchRule condition, the request's |
| # path must begin with the specified prefixMatch.prefixMatch must begin with a /. |
| # |
| # The value must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "queryParameterMatches": [ # 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. |
| { # HttpRouteRuleMatch criteria for a request's query parameter. |
| "exactMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter exactly matches the contents of exactMatch. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "name": "A String", # The name of the query parameter to match. The query parameter must exist in |
| # the request, in the absence of which the request match fails. |
| "presentMatch": True or False, # Specifies that the queryParameterMatch matches if the |
| # request contains the query parameter, irrespective of whether the |
| # parameter has a value or not. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "regexMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter matches the regular expression specified byregexMatch. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "regexMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor |
| # supplied with the original URL. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of prefixMatch, fullPathMatch orregexMatch must be |
| # specified. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "priority": 42, # For routeRules within a given pathMatcher, |
| # priority determines the order in which a load balancer interpretsrouteRules. RouteRules 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. |
| "routeAction": { # In response to a matching matchRule, 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a route rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| }, |
| ], |
| "region": "A String", # [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. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "tests": [ # The list of expected URL mapping tests. Request to update theUrlMap succeeds only if all test cases pass. You can specify a |
| # maximum of 100 tests per UrlMap. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Message for the expected URL mappings. |
| "backendServiceWeight": 42, # The weight to use for the supplied host and path when using advanced |
| # routing rules that involve traffic splitting. |
| "description": "A String", # Description of this test case. |
| "expectedOutputUrl": "A String", # 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 whenexpectedOutputUrl matches the request forwarded by |
| # the load balancer to backends. For rules with urlRewrite, |
| # the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored. |
| # |
| # For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer's |
| # redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. |
| # If urlRedirect specifies strip_query, the test |
| # passes only if expectedOutputUrl does not contain any query |
| # parameters. |
| # |
| # expectedOutputUrl is optional whenservice is specified. |
| "expectedRedirectResponseCode": 42, # For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in |
| # load balancer's redirect response. |
| # |
| # expectedRedirectResponseCode cannot be set whenservice is set. |
| "expectedUrlRedirect": "A String", # The expected URL that should be redirected to for the host and path |
| # being tested. |
| # [Deprecated] This field is deprecated. |
| # Use expected_output_url instead. |
| "headers": [ # HTTP headers for this request. If headers contains |
| # a host header, then host must also match the header value. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. If headers contains a host header, |
| # then host must also match the header value. |
| "path": "A String", # Path portion of the URL. |
| "service": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| # |
| # The service field cannot |
| # be set if expectedRedirectResponseCode is set. |
| }, |
| ], |
| } |
| |
| requestId: string, An optional request ID to identify requests. Specify a unique request ID so |
| that if you must retry your request, the server will know to ignore the |
| request if it has already been completed. |
| |
| For example, consider a situation where you make an initial request and |
| the request times out. If you make the request again with the same |
| request ID, the server can check if original operation with the same |
| request ID was received, and if so, will ignore the second request. This |
| prevents clients from accidentally creating duplicate commitments. |
| |
| The request ID must be |
| a valid UUID with the exception that zero UUID is not supported |
| (00000000-0000-0000-0000-000000000000). |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # Represents an Operation resource. |
| # |
| # Google Compute Engine has three Operation resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/globalOperations) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionOperations) |
| # * [Zonal](/compute/docs/reference/rest/alpha/zoneOperations) |
| # |
| # You can use an operation resource to manage asynchronous API requests. |
| # For more information, readHandling |
| # API responses. |
| # |
| # Operations can be global, regional or zonal. |
| # |
| # - For global operations, use the `globalOperations` |
| # resource. |
| # - For regional operations, use the |
| # `regionOperations` resource. |
| # - For zonal operations, use |
| # the `zoneOperations` resource. |
| # |
| # |
| # |
| # For more information, read |
| # Global, Regional, and Zonal Resources. |
| # |
| # Note that completed Operation resources have a limited |
| # retention period. |
| "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. |
| # Not present otherwise. |
| "creationTimestamp": "A String", # [Deprecated] This field is deprecated. |
| "description": "A String", # [Output Only] A textual description of the operation, which is |
| # set when the operation is created. |
| "endTime": "A String", # [Output Only] The time that this operation was completed. This value is inRFC3339 |
| # text format. |
| "error": { # [Output Only] If errors are generated during processing of the operation, |
| # this field will be populated. |
| "errors": [ # [Output Only] The array of errors encountered while processing this |
| # operation. |
| { |
| "code": "A String", # [Output Only] The error type identifier for this error. |
| "errorDetails": [ # [Output Only] An optional list of messages that contain the error |
| # details. There is a set of defined message types to use for providing |
| # details.The syntax depends on the error code. For example, |
| # QuotaExceededInfo will have details when the error code is |
| # QUOTA_EXCEEDED. |
| { |
| "errorInfo": { # Describes the cause of the error with structured details. |
| # |
| # Example of an error when contacting the "pubsub.googleapis.com" API when it |
| # is not enabled: |
| # |
| # { "reason": "API_DISABLED" |
| # "domain": "googleapis.com" |
| # "metadata": { |
| # "resource": "projects/123", |
| # "service": "pubsub.googleapis.com" |
| # } |
| # } |
| # |
| # This response indicates that the pubsub.googleapis.com API is not enabled. |
| # |
| # Example of an error that is returned when attempting to create a Spanner |
| # instance in a region that is out of stock: |
| # |
| # { "reason": "STOCKOUT" |
| # "domain": "spanner.googleapis.com", |
| # "metadata": { |
| # "availableRegions": "us-central1,us-east2" |
| # } |
| # } |
| "domain": "A String", # The logical grouping to which the "reason" belongs. The error domain |
| # is typically the registered service name of the tool or product that |
| # generates the error. Example: "pubsub.googleapis.com". If the error is |
| # generated by some common infrastructure, the error domain must be a |
| # globally unique value that identifies the infrastructure. For Google API |
| # infrastructure, the error domain is "googleapis.com". |
| "metadatas": { # Additional structured details about this error. |
| # |
| # Keys must match a regular expression of `a-z+` but should |
| # ideally be lowerCamelCase. Also, they must be limited to 64 characters in |
| # length. When identifying the current value of an exceeded limit, the units |
| # should be contained in the key, not the value. For example, rather than |
| # `{"instanceLimit": "100/request"}`, should be returned as, |
| # `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| # instances that can be created in a single (batch) request. |
| "a_key": "A String", |
| }, |
| "reason": "A String", # The reason of the error. This is a constant value that identifies the |
| # proximate cause of the error. Error reasons are unique within a particular |
| # domain of errors. This should be at most 63 characters and match a |
| # regular expression of `A-Z+[A-Z0-9]`, which represents |
| # UPPER_SNAKE_CASE. |
| }, |
| "help": { # Provides links to documentation or for performing an out of band action. |
| # |
| # For example, if a quota check failed with an error indicating the calling |
| # project hasn't enabled the accessed service, this can contain a URL pointing |
| # directly to the right place in the developer console to flip the bit. |
| "links": [ # URL(s) pointing to additional information on handling the current error. |
| { # Describes a URL link. |
| "description": "A String", # Describes what the link offers. |
| "url": "A String", # The URL of the link. |
| }, |
| ], |
| }, |
| "localizedMessage": { # Provides a localized error message that is safe to return to the user |
| # which can be attached to an RPC error. |
| "locale": "A String", # The locale used following the specification defined at |
| # https://www.rfc-editor.org/rfc/bcp/bcp47.txt. |
| # Examples are: "en-US", "fr-CH", "es-MX" |
| "message": "A String", # The localized error message in the above locale. |
| }, |
| "quotaInfo": { # Additional details for quota exceeded error for resource quota. |
| "dimensions": { # The map holding related quota dimensions. |
| "a_key": "A String", |
| }, |
| "futureLimit": 3.14, # Future quota limit being rolled out. The limit's unit depends on the quota |
| # type or metric. |
| "limit": 3.14, # Current effective quota limit. The limit's unit depends on the quota type |
| # or metric. |
| "limitName": "A String", # The name of the quota limit. |
| "metricName": "A String", # The Compute Engine quota metric name. |
| "rolloutStatus": "A String", # Rollout status of the future quota limit. |
| }, |
| }, |
| ], |
| "location": "A String", # [Output Only] Indicates the field in the request that caused the error. |
| # This property is optional. |
| "message": "A String", # [Output Only] An optional, human-readable error message. |
| }, |
| ], |
| }, |
| "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error |
| # message that was returned, such as `NOT FOUND`. |
| "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error |
| # status code that was returned. For example, a `404` means the |
| # resource was not found. |
| "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is |
| # defined by the server. |
| "insertTime": "A String", # [Output Only] The time that this operation was requested. |
| # This value is inRFC3339 |
| # text format. |
| "instancesBulkInsertOperationMetadata": { |
| "perLocationStatus": { # Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "createdVmCount": 42, # [Output Only] Count of VMs successfully created so far. |
| "deletedVmCount": 42, # [Output Only] Count of VMs that got deleted during rollback. |
| "failedToCreateVmCount": 42, # [Output Only] Count of VMs that started creating but encountered an |
| # error. |
| "status": "A String", # [Output Only] Creation status of BulkInsert operation - information |
| # if the flow is rolling forward or rolling back. |
| "targetVmCount": 42, # [Output Only] Count of VMs originally planned to be created. |
| }, |
| }, |
| }, |
| "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for |
| # Operation resources. |
| "name": "A String", # [Output Only] Name of the operation. |
| "operationGroupId": "A String", # [Output Only] An ID that represents a group of operations, such as when a |
| # group of operations results from a `bulkInsert` API request. |
| "operationType": "A String", # [Output Only] The type of operation, such as `insert`, |
| # `update`, or `delete`, and so on. |
| "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. |
| # There is no requirement that this be linear or support any granularity of |
| # operations. This should not be used to guess when the operation will be |
| # complete. This number should monotonically increase as the operation |
| # progresses. |
| "region": "A String", # [Output Only] The URL of the region where the operation resides. Only |
| # applicable when performing regional operations. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. |
| "setCommonInstanceMetadataOperationMetadata": { # [Output Only] If the operation is for projects.setCommonInstanceMetadata, |
| # this field will contain information on all underlying zonal actions and |
| # their state. |
| "clientOperationId": "A String", # [Output Only] The client operation id. |
| "perLocationOperations": { # [Output Only] Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "error": { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is |
| # populated. |
| # different programming environments, including REST APIs and RPC APIs. It is |
| # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| # three pieces of data: error code, error message, and error details. |
| # |
| # You can find out more about this error model and how to work with it in the |
| # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| "details": [ # A list of messages that carry the error details. There is a common set of |
| # message types for APIs to use. |
| { |
| "a_key": "", # Properties of the object. Contains field @type with type URL. |
| }, |
| ], |
| "message": "A String", # A developer-facing error message, which should be in English. Any |
| # user-facing error message should be localized and sent in the |
| # google.rpc.Status.details field, or localized by the client. |
| }, |
| "state": "A String", # [Output Only] Status of the action, which can be one of the following: |
| # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. |
| }, |
| }, |
| }, |
| "startTime": "A String", # [Output Only] The time that this operation was started by the server. |
| # This value is inRFC3339 |
| # text format. |
| "status": "A String", # [Output Only] The status of the operation, which can be one of the |
| # following: |
| # `PENDING`, `RUNNING`, or `DONE`. |
| "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the |
| # operation. |
| "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation |
| # of the target resource. |
| "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For |
| # operations related to creating a snapshot, this points to the disk |
| # that the snapshot was created from. |
| "user": "A String", # [Output Only] User who requested the operation, for example: |
| # `[email protected]` or |
| # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. |
| "warnings": [ # [Output Only] If warning messages are generated during processing of the |
| # operation, this field will be populated. |
| { |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| ], |
| "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only |
| # applicable when performing per-zone operations. |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="testIamPermissions">testIamPermissions(project, resource, body=None, x__xgafv=None)</code> |
| <pre>Returns permissions that a caller has on the specified resource. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| resource: string, Name or id of the resource for this request. (required) |
| body: object, The request body. |
| The object takes the form of: |
| |
| { |
| "permissions": [ # The set of permissions to check for the 'resource'. Permissions with |
| # wildcards (such as '*' or 'storage.*') are not allowed. |
| "A String", |
| ], |
| } |
| |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { |
| "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is |
| # allowed. |
| "A String", |
| ], |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="update">update(project, urlMap, body=None, requestId=None, x__xgafv=None)</code> |
| <pre>Updates the specified UrlMap resource with the data included in the |
| request. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| urlMap: string, Name of the UrlMap resource to update. (required) |
| body: object, The request body. |
| The object takes the form of: |
| |
| { # Represents a URL Map resource. |
| # |
| # Compute Engine has two URL Map resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/urlMaps) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionUrlMaps) |
| # |
| # 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 aloadBalancingScheme of INTERNAL_MANAGED. For more |
| # information, read URL |
| # Map Concepts. |
| "creationTimestamp": "A String", # [Output Only] Creation timestamp inRFC3339 |
| # text format. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket 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: |
| # |
| # |
| # - defaultCustomErrorResponsePolicy containing policies for |
| # responding to 5xx and 4xx errors |
| # - A PathMatcher configured for *.example.com has |
| # defaultCustomErrorResponsePolicy for 4xx. |
| # |
| # If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. |
| # When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When |
| # a request that does not match any host in *.example.com such |
| # as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only |
| # once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # hostRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within defaultRouteAction. |
| # |
| # |
| # defaultRouteAction has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL of the defaultService resource to |
| # which traffic is directed if none of the hostRules match. |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # defaultService has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request |
| # is redirected to a URL specified by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "fingerprint": "A String", # 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 UrlMap. An up-to-date fingerprint must be provided |
| # in order to update the UrlMap, otherwise the request will |
| # fail with error 412 conditionNotMet. |
| # |
| # To see the latest fingerprint, make a get() request to |
| # retrieve a UrlMap. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction specified here take effect afterheaderAction specified under pathMatcher. |
| # |
| # headerAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "hostRules": [ # The list of host rules to use against the URL. |
| { # UrlMaps |
| # A host-matching rule for a URL. If matched, will use the namedPathMatcher to select the BackendService. |
| "description": "A String", # 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 host:port.* matches any string of ([a-z0-9-.]*). 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 validateForProxyless field |
| # set to true. |
| "A String", |
| ], |
| "pathMatcher": "A String", # The name of the PathMatcher to use to match the path portion |
| # of the URL if the hostRule matches the URL's host portion. |
| }, |
| ], |
| "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is |
| # defined by the server. |
| "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for |
| # url maps. |
| "name": "A String", # Name of the resource. Provided by the client when the resource is created. |
| # The name must be 1-63 characters long, and comply withRFC1035. |
| # Specifically, the name must be 1-63 characters long and match the regular |
| # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first |
| # character must be a lowercase letter, and all following characters must |
| # be a dash, lowercase letter, or digit, except the last character, which |
| # cannot be a dash. |
| "pathMatchers": [ # The list of named PathMatchers to use against the URL. |
| { # 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. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # This policy takes |
| # effect at the PathMatcher level and applies only when no |
| # policy has been defined for the error code at lower levels likeRouteRule and PathRule within thisPathMatcher. If an error code does not have a policy defined |
| # in defaultCustomErrorResponsePolicy, then a policy defined for |
| # the error code in UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # For example, consider a UrlMap with the following |
| # configuration: |
| # |
| # |
| # - UrlMap.defaultCustomErrorResponsePolicy is configured |
| # with policies for 5xx and 4xx errors |
| # - A RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withpathMatcher.defaultRouteAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # pathRules or routeRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path matcher'sdefaultRouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL to the BackendService resource. This |
| # URL is used if none of the pathRules orrouteRules defined by this PathMatcher are |
| # matched. For example, the |
| # following are all valid URLs to a BackendService resource: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService |
| # - compute/v1/projects/project/global/backendServices/backendService |
| # - global/backendServices/backendService |
| # |
| # |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Authorization requires one or more of the following Google IAM permissions on the |
| # specified resource default_service: |
| # |
| # |
| # - compute.backendBuckets.use |
| # - compute.backendServices.use |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified pathRules orrouteRules match, the request is redirected to a URL specified |
| # by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backend service. |
| # |
| # HeaderAction specified here are applied after the matchingHttpRouteRule HeaderAction and before theHeaderAction in the UrlMap |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "name": "A String", # The name to which this PathMatcher is referred by theHostRule. |
| "pathRules": [ # The list of path rules. Use this list instead of routeRules |
| # 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 pathRule 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 pathMatcher, only one ofpathRules or routeRules must be set. |
| { # A path-matching rule for a URL. If matched, will use the specifiedBackendService to handle the traffic arriving at this URL. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the PathRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.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 atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "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. |
| "A String", |
| ], |
| "routeAction": { # 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When a path pattern is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| "routeRules": [ # The list of HTTP route rules. Use this list instead ofpathRules when advanced route matching and routing actions are |
| # desired. routeRules are evaluated in order of priority, from |
| # the lowest to highest number. |
| # |
| # Within a given pathMatcher, you can set only one ofpathRules or routeRules. |
| { # The HttpRouteRule setting specifies how to match an HTTP request |
| # and the corresponding routing action that load balancing proxies perform. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the RouteRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withrouteRules.routeAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thecustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the customErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "description": "A String", # The short description conveying the intent of this routeRule. |
| # |
| # |
| # The description can have a maximum length of 1024 characters. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction value specified here is applied before the |
| # matching pathMatchers[].headerAction and afterpathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "httpFilterConfigs": [ # Outbound route specific configuration fornetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterConfigs only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "httpFilterMetadata": [ # Outbound route specific metadata supplied tonetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterMetadata only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # The only configTypeUrl supported istype.googleapis.com/google.protobuf.Struct |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "matchRules": [ # The list of criteria for matching attributes of a request to thisrouteRule. This list has OR semantics: the request matches |
| # this routeRule when any of thematchRules are satisfied. However predicates within |
| # a given matchRule have AND semantics. All predicates |
| # within a matchRule must match for the request to |
| # match the rule. |
| { # HttpRouteRuleMatch specifies a set of criteria for matching |
| # requests to an HttpRouteRule. All specified criteria must |
| # be satisfied for a match to occur. |
| "fullPathMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must exactly match the value specified infullPathMatch after removing any query parameters and anchor |
| # that may be part of the original URL. |
| # |
| # fullPathMatch must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "headerMatches": [ # Specifies a list of header match criteria, all of which must match |
| # corresponding headers in the request. |
| { # matchRule criteria for request header matches. |
| "exactMatch": "A String", # The value should exactly match contents of exactMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "headerName": "A String", # 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 validateForProxyless field set to true, only |
| # non-binary |
| # user-specified custom metadata and the `content-type` header are supported. |
| # The following transport-level headers cannot be used in header matching |
| # rules: |
| # `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, |
| # `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, |
| # `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, |
| # `grpc-timeout` and `grpc-trace-bin`. |
| "invertMatch": True or False, # If set to false, the headerMatch is considered a |
| # match if the preceding match criteria are met. If set to true, |
| # the headerMatch is considered a match if the preceding |
| # match criteria are NOT met. |
| # |
| # The default setting is false. |
| "prefixMatch": "A String", # The value of the header must start with the contents ofprefixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "presentMatch": True or False, # A header with the contents of headerName must exist. The |
| # match takes place whether or not the request's header has a value. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay # The header value must be an integer and its value must be in the range |
| # specified in rangeMatch. If the header does not contain an |
| # integer, number or is empty, the match fails. |
| # |
| # For example for a range [-5, 0] |
| # |
| # |
| # - -3 will match. |
| # - 0 will not match. |
| # - 0.25 will not match. |
| # - -3someString will not match. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # rangeMatch is not supported for load balancers |
| # that have loadBalancingScheme set to EXTERNAL. |
| # within the specified integer range. |
| "rangeEnd": "A String", # The end of the range (exclusive) in signed long integer format. |
| "rangeStart": "A String", # The start of the range (inclusive) in signed long integer format. |
| }, |
| "regexMatch": "A String", # The value of the header must match the regular expression specified inregexMatch. |
| # 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 exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "suffixMatch": "A String", # The value of the header must end with the contents ofsuffixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| }, |
| ], |
| "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch |
| # 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. |
| "metadataFilters": [ # 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 metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels 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. |
| # |
| # metadataFilters specified here is applied after those |
| # specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to. |
| # |
| # metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Opaque filter criteria used by load balancers to restrict routing |
| # configuration to a limited set of load balancing proxies. Proxies and |
| # sidecars involved in load balancing would typically present metadata to the |
| # load balancers that need to match criteria specified here. If a match takes |
| # place, the relevant configuration is made available to those |
| # proxies. |
| # |
| # For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least |
| # one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels must match with |
| # corresponding labels provided in the metadata. |
| # |
| # An example for using metadataFilters would be: if |
| # load balancing involves |
| # Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers. |
| "filterLabels": [ # The list of label value pairs that must match labels in the provided |
| # metadata based on filterMatchCriteria |
| # |
| # This list must not be empty and can have at the most 64 entries. |
| { # MetadataFilter label name value pairs that are expected |
| # to match corresponding labels presented as metadata to the load balancer. |
| "name": "A String", # Name of metadata label. |
| # |
| # The name can have a maximum length of 1024 characters and must be at |
| # least 1 character long. |
| "value": "A String", # The value of the label must match the specified value. |
| # |
| # value can have a maximum length of 1024 characters. |
| }, |
| ], |
| "filterMatchCriteria": "A String", # Specifies how individual filter label matches |
| # within the list of filterLabels and contributes toward the |
| # overall metadataFilter match. |
| # |
| # Supported values are: |
| # |
| # - MATCH_ANY: at least one of the filterLabels |
| # must have a matching label in the provided metadata. |
| # - MATCH_ALL: all filterLabels must have |
| # matching labels in the provided metadata. |
| }, |
| ], |
| "pathTemplateMatch": "A String", # 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 |
| # |
| # |
| # - The value must be between 1 and 1024 characters |
| # - The pattern must start with a leading slash ("/") |
| # - There may be no more than 5 operators in pattern |
| # |
| # Precisely one ofprefix_match, full_path_match,regex_match or path_template_match must be set. |
| "prefixMatch": "A String", # For satisfying the matchRule condition, the request's |
| # path must begin with the specified prefixMatch.prefixMatch must begin with a /. |
| # |
| # The value must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "queryParameterMatches": [ # 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. |
| { # HttpRouteRuleMatch criteria for a request's query parameter. |
| "exactMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter exactly matches the contents of exactMatch. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "name": "A String", # The name of the query parameter to match. The query parameter must exist in |
| # the request, in the absence of which the request match fails. |
| "presentMatch": True or False, # Specifies that the queryParameterMatch matches if the |
| # request contains the query parameter, irrespective of whether the |
| # parameter has a value or not. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "regexMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter matches the regular expression specified byregexMatch. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "regexMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor |
| # supplied with the original URL. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of prefixMatch, fullPathMatch orregexMatch must be |
| # specified. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "priority": 42, # For routeRules within a given pathMatcher, |
| # priority determines the order in which a load balancer interpretsrouteRules. RouteRules 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. |
| "routeAction": { # In response to a matching matchRule, 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a route rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| }, |
| ], |
| "region": "A String", # [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. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "tests": [ # The list of expected URL mapping tests. Request to update theUrlMap succeeds only if all test cases pass. You can specify a |
| # maximum of 100 tests per UrlMap. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Message for the expected URL mappings. |
| "backendServiceWeight": 42, # The weight to use for the supplied host and path when using advanced |
| # routing rules that involve traffic splitting. |
| "description": "A String", # Description of this test case. |
| "expectedOutputUrl": "A String", # 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 whenexpectedOutputUrl matches the request forwarded by |
| # the load balancer to backends. For rules with urlRewrite, |
| # the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored. |
| # |
| # For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer's |
| # redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. |
| # If urlRedirect specifies strip_query, the test |
| # passes only if expectedOutputUrl does not contain any query |
| # parameters. |
| # |
| # expectedOutputUrl is optional whenservice is specified. |
| "expectedRedirectResponseCode": 42, # For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in |
| # load balancer's redirect response. |
| # |
| # expectedRedirectResponseCode cannot be set whenservice is set. |
| "expectedUrlRedirect": "A String", # The expected URL that should be redirected to for the host and path |
| # being tested. |
| # [Deprecated] This field is deprecated. |
| # Use expected_output_url instead. |
| "headers": [ # HTTP headers for this request. If headers contains |
| # a host header, then host must also match the header value. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. If headers contains a host header, |
| # then host must also match the header value. |
| "path": "A String", # Path portion of the URL. |
| "service": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| # |
| # The service field cannot |
| # be set if expectedRedirectResponseCode is set. |
| }, |
| ], |
| } |
| |
| requestId: string, An optional request ID to identify requests. Specify a unique request ID so |
| that if you must retry your request, the server will know to ignore the |
| request if it has already been completed. |
| |
| For example, consider a situation where you make an initial request and |
| the request times out. If you make the request again with the same |
| request ID, the server can check if original operation with the same |
| request ID was received, and if so, will ignore the second request. This |
| prevents clients from accidentally creating duplicate commitments. |
| |
| The request ID must be |
| a valid UUID with the exception that zero UUID is not supported |
| (00000000-0000-0000-0000-000000000000). |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # Represents an Operation resource. |
| # |
| # Google Compute Engine has three Operation resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/globalOperations) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionOperations) |
| # * [Zonal](/compute/docs/reference/rest/alpha/zoneOperations) |
| # |
| # You can use an operation resource to manage asynchronous API requests. |
| # For more information, readHandling |
| # API responses. |
| # |
| # Operations can be global, regional or zonal. |
| # |
| # - For global operations, use the `globalOperations` |
| # resource. |
| # - For regional operations, use the |
| # `regionOperations` resource. |
| # - For zonal operations, use |
| # the `zoneOperations` resource. |
| # |
| # |
| # |
| # For more information, read |
| # Global, Regional, and Zonal Resources. |
| # |
| # Note that completed Operation resources have a limited |
| # retention period. |
| "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. |
| # Not present otherwise. |
| "creationTimestamp": "A String", # [Deprecated] This field is deprecated. |
| "description": "A String", # [Output Only] A textual description of the operation, which is |
| # set when the operation is created. |
| "endTime": "A String", # [Output Only] The time that this operation was completed. This value is inRFC3339 |
| # text format. |
| "error": { # [Output Only] If errors are generated during processing of the operation, |
| # this field will be populated. |
| "errors": [ # [Output Only] The array of errors encountered while processing this |
| # operation. |
| { |
| "code": "A String", # [Output Only] The error type identifier for this error. |
| "errorDetails": [ # [Output Only] An optional list of messages that contain the error |
| # details. There is a set of defined message types to use for providing |
| # details.The syntax depends on the error code. For example, |
| # QuotaExceededInfo will have details when the error code is |
| # QUOTA_EXCEEDED. |
| { |
| "errorInfo": { # Describes the cause of the error with structured details. |
| # |
| # Example of an error when contacting the "pubsub.googleapis.com" API when it |
| # is not enabled: |
| # |
| # { "reason": "API_DISABLED" |
| # "domain": "googleapis.com" |
| # "metadata": { |
| # "resource": "projects/123", |
| # "service": "pubsub.googleapis.com" |
| # } |
| # } |
| # |
| # This response indicates that the pubsub.googleapis.com API is not enabled. |
| # |
| # Example of an error that is returned when attempting to create a Spanner |
| # instance in a region that is out of stock: |
| # |
| # { "reason": "STOCKOUT" |
| # "domain": "spanner.googleapis.com", |
| # "metadata": { |
| # "availableRegions": "us-central1,us-east2" |
| # } |
| # } |
| "domain": "A String", # The logical grouping to which the "reason" belongs. The error domain |
| # is typically the registered service name of the tool or product that |
| # generates the error. Example: "pubsub.googleapis.com". If the error is |
| # generated by some common infrastructure, the error domain must be a |
| # globally unique value that identifies the infrastructure. For Google API |
| # infrastructure, the error domain is "googleapis.com". |
| "metadatas": { # Additional structured details about this error. |
| # |
| # Keys must match a regular expression of `a-z+` but should |
| # ideally be lowerCamelCase. Also, they must be limited to 64 characters in |
| # length. When identifying the current value of an exceeded limit, the units |
| # should be contained in the key, not the value. For example, rather than |
| # `{"instanceLimit": "100/request"}`, should be returned as, |
| # `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| # instances that can be created in a single (batch) request. |
| "a_key": "A String", |
| }, |
| "reason": "A String", # The reason of the error. This is a constant value that identifies the |
| # proximate cause of the error. Error reasons are unique within a particular |
| # domain of errors. This should be at most 63 characters and match a |
| # regular expression of `A-Z+[A-Z0-9]`, which represents |
| # UPPER_SNAKE_CASE. |
| }, |
| "help": { # Provides links to documentation or for performing an out of band action. |
| # |
| # For example, if a quota check failed with an error indicating the calling |
| # project hasn't enabled the accessed service, this can contain a URL pointing |
| # directly to the right place in the developer console to flip the bit. |
| "links": [ # URL(s) pointing to additional information on handling the current error. |
| { # Describes a URL link. |
| "description": "A String", # Describes what the link offers. |
| "url": "A String", # The URL of the link. |
| }, |
| ], |
| }, |
| "localizedMessage": { # Provides a localized error message that is safe to return to the user |
| # which can be attached to an RPC error. |
| "locale": "A String", # The locale used following the specification defined at |
| # https://www.rfc-editor.org/rfc/bcp/bcp47.txt. |
| # Examples are: "en-US", "fr-CH", "es-MX" |
| "message": "A String", # The localized error message in the above locale. |
| }, |
| "quotaInfo": { # Additional details for quota exceeded error for resource quota. |
| "dimensions": { # The map holding related quota dimensions. |
| "a_key": "A String", |
| }, |
| "futureLimit": 3.14, # Future quota limit being rolled out. The limit's unit depends on the quota |
| # type or metric. |
| "limit": 3.14, # Current effective quota limit. The limit's unit depends on the quota type |
| # or metric. |
| "limitName": "A String", # The name of the quota limit. |
| "metricName": "A String", # The Compute Engine quota metric name. |
| "rolloutStatus": "A String", # Rollout status of the future quota limit. |
| }, |
| }, |
| ], |
| "location": "A String", # [Output Only] Indicates the field in the request that caused the error. |
| # This property is optional. |
| "message": "A String", # [Output Only] An optional, human-readable error message. |
| }, |
| ], |
| }, |
| "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error |
| # message that was returned, such as `NOT FOUND`. |
| "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error |
| # status code that was returned. For example, a `404` means the |
| # resource was not found. |
| "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is |
| # defined by the server. |
| "insertTime": "A String", # [Output Only] The time that this operation was requested. |
| # This value is inRFC3339 |
| # text format. |
| "instancesBulkInsertOperationMetadata": { |
| "perLocationStatus": { # Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "createdVmCount": 42, # [Output Only] Count of VMs successfully created so far. |
| "deletedVmCount": 42, # [Output Only] Count of VMs that got deleted during rollback. |
| "failedToCreateVmCount": 42, # [Output Only] Count of VMs that started creating but encountered an |
| # error. |
| "status": "A String", # [Output Only] Creation status of BulkInsert operation - information |
| # if the flow is rolling forward or rolling back. |
| "targetVmCount": 42, # [Output Only] Count of VMs originally planned to be created. |
| }, |
| }, |
| }, |
| "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for |
| # Operation resources. |
| "name": "A String", # [Output Only] Name of the operation. |
| "operationGroupId": "A String", # [Output Only] An ID that represents a group of operations, such as when a |
| # group of operations results from a `bulkInsert` API request. |
| "operationType": "A String", # [Output Only] The type of operation, such as `insert`, |
| # `update`, or `delete`, and so on. |
| "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. |
| # There is no requirement that this be linear or support any granularity of |
| # operations. This should not be used to guess when the operation will be |
| # complete. This number should monotonically increase as the operation |
| # progresses. |
| "region": "A String", # [Output Only] The URL of the region where the operation resides. Only |
| # applicable when performing regional operations. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. |
| "setCommonInstanceMetadataOperationMetadata": { # [Output Only] If the operation is for projects.setCommonInstanceMetadata, |
| # this field will contain information on all underlying zonal actions and |
| # their state. |
| "clientOperationId": "A String", # [Output Only] The client operation id. |
| "perLocationOperations": { # [Output Only] Status information per location (location name is key). |
| # Example key: zones/us-central1-a |
| "a_key": { |
| "error": { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is |
| # populated. |
| # different programming environments, including REST APIs and RPC APIs. It is |
| # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| # three pieces of data: error code, error message, and error details. |
| # |
| # You can find out more about this error model and how to work with it in the |
| # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| "details": [ # A list of messages that carry the error details. There is a common set of |
| # message types for APIs to use. |
| { |
| "a_key": "", # Properties of the object. Contains field @type with type URL. |
| }, |
| ], |
| "message": "A String", # A developer-facing error message, which should be in English. Any |
| # user-facing error message should be localized and sent in the |
| # google.rpc.Status.details field, or localized by the client. |
| }, |
| "state": "A String", # [Output Only] Status of the action, which can be one of the following: |
| # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. |
| }, |
| }, |
| }, |
| "startTime": "A String", # [Output Only] The time that this operation was started by the server. |
| # This value is inRFC3339 |
| # text format. |
| "status": "A String", # [Output Only] The status of the operation, which can be one of the |
| # following: |
| # `PENDING`, `RUNNING`, or `DONE`. |
| "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the |
| # operation. |
| "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation |
| # of the target resource. |
| "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For |
| # operations related to creating a snapshot, this points to the disk |
| # that the snapshot was created from. |
| "user": "A String", # [Output Only] User who requested the operation, for example: |
| # `[email protected]` or |
| # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. |
| "warnings": [ # [Output Only] If warning messages are generated during processing of the |
| # operation, this field will be populated. |
| { |
| "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute |
| # Engine returns NO_RESULTS_ON_PAGE if there |
| # are no results in the response. |
| "data": [ # [Output Only] Metadata about this warning in key: |
| # value format. For example: |
| # |
| # "data": [ |
| # { |
| # "key": "scope", |
| # "value": "zones/us-east1-d" |
| # } |
| { |
| "key": "A String", # [Output Only] A key that provides more detail on the warning being |
| # returned. For example, for warnings where there are no results in a list |
| # request for a particular zone, this key might be scope and |
| # the key value might be the zone name. Other examples might be a key |
| # indicating a deprecated resource and a suggested replacement, or a |
| # warning about invalid network settings (for example, if an instance |
| # attempts to perform IP forwarding but is not enabled for IP forwarding). |
| "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| }, |
| ], |
| "message": "A String", # [Output Only] A human-readable description of the warning code. |
| }, |
| ], |
| "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only |
| # applicable when performing per-zone operations. |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="validate">validate(project, urlMap, body=None, x__xgafv=None)</code> |
| <pre>Runs static validation for the UrlMap. In particular, the tests of the |
| provided UrlMap will be run. Calling this method does NOT create the |
| UrlMap. |
| |
| Args: |
| project: string, Project ID for this request. (required) |
| urlMap: string, Name of the UrlMap resource to be validated as. (required) |
| body: object, The request body. |
| The object takes the form of: |
| |
| { |
| "loadBalancingSchemes": [ # Specifies the load balancer type(s) this validation request is for. UseEXTERNAL_MANAGED for global external Application Load |
| # Balancers and regional external Application Load Balancers. |
| # Use EXTERNAL for classic Application Load Balancers. |
| # |
| # Use INTERNAL_MANAGED for internal Application Load Balancers. For more |
| # information, refer to Choosing |
| # a load balancer. |
| # |
| # If unspecified, the load balancing scheme will be inferred from the backend |
| # service resources this URL map references. If that can not be inferred (for |
| # example, this URL map only references backend buckets, or this Url map is |
| # for rewrites and redirects only and doesn't reference any backends),EXTERNAL will be used as the default type. |
| # |
| # If specified, the scheme(s) must not conflict with the load balancing |
| # scheme of the backend service resources this Url map references. |
| "A String", |
| ], |
| "resource": { # Represents a URL Map resource. # Content of the UrlMap to be validated. |
| # |
| # Compute Engine has two URL Map resources: |
| # |
| # * [Global](/compute/docs/reference/rest/alpha/urlMaps) |
| # * [Regional](/compute/docs/reference/rest/alpha/regionUrlMaps) |
| # |
| # 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 aloadBalancingScheme of INTERNAL_MANAGED. For more |
| # information, read URL |
| # Map Concepts. |
| "creationTimestamp": "A String", # [Output Only] Creation timestamp inRFC3339 |
| # text format. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket 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: |
| # |
| # |
| # - defaultCustomErrorResponsePolicy containing policies for |
| # responding to 5xx and 4xx errors |
| # - A PathMatcher configured for *.example.com has |
| # defaultCustomErrorResponsePolicy for 4xx. |
| # |
| # If a request for http://www.example.com/ encounters a404, the policy inpathMatcher.defaultCustomErrorResponsePolicy will be enforced. |
| # When the request for http://www.example.com/ encounters a502, the policy inUrlMap.defaultCustomErrorResponsePolicy will be enforced. When |
| # a request that does not match any host in *.example.com such |
| # as http://www.myotherexample.com/, encounters a404, UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # When used in conjunction withdefaultRouteAction.retryPolicy, retries take precedence. Only |
| # once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # hostRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within defaultRouteAction. |
| # |
| # |
| # defaultRouteAction has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL of the defaultService resource to |
| # which traffic is directed if none of the hostRules match. |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # defaultService has no effect when the URL map is bound |
| # to a target gRPC proxy that has the validateForProxyless field |
| # set to true. |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request |
| # is redirected to a URL specified by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "fingerprint": "A String", # 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 UrlMap. An up-to-date fingerprint must be provided |
| # in order to update the UrlMap, otherwise the request will |
| # fail with error 412 conditionNotMet. |
| # |
| # To see the latest fingerprint, make a get() request to |
| # retrieve a UrlMap. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction specified here take effect afterheaderAction specified under pathMatcher. |
| # |
| # headerAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "hostRules": [ # The list of host rules to use against the URL. |
| { # UrlMaps |
| # A host-matching rule for a URL. If matched, will use the namedPathMatcher to select the BackendService. |
| "description": "A String", # 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 host:port.* matches any string of ([a-z0-9-.]*). 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 validateForProxyless field |
| # set to true. |
| "A String", |
| ], |
| "pathMatcher": "A String", # The name of the PathMatcher to use to match the path portion |
| # of the URL if the hostRule matches the URL's host portion. |
| }, |
| ], |
| "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is |
| # defined by the server. |
| "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for |
| # url maps. |
| "name": "A String", # Name of the resource. Provided by the client when the resource is created. |
| # The name must be 1-63 characters long, and comply withRFC1035. |
| # Specifically, the name must be 1-63 characters long and match the regular |
| # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first |
| # character must be a lowercase letter, and all following characters must |
| # be a dash, lowercase letter, or digit, except the last character, which |
| # cannot be a dash. |
| "pathMatchers": [ # The list of named PathMatchers to use against the URL. |
| { # 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. |
| "defaultCustomErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # defaultCustomErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # This policy takes |
| # effect at the PathMatcher level and applies only when no |
| # policy has been defined for the error code at lower levels likeRouteRule and PathRule within thisPathMatcher. If an error code does not have a policy defined |
| # in defaultCustomErrorResponsePolicy, then a policy defined for |
| # the error code in UrlMap.defaultCustomErrorResponsePolicy |
| # takes effect. |
| # |
| # For example, consider a UrlMap with the following |
| # configuration: |
| # |
| # |
| # - UrlMap.defaultCustomErrorResponsePolicy is configured |
| # with policies for 5xx and 4xx errors |
| # - A RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withpathMatcher.defaultRouteAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thedefaultCustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the defaultCustomErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # defaultCustomErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "defaultRouteAction": { # defaultRouteAction takes effect when none of the |
| # pathRules or routeRules 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 defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path matcher'sdefaultRouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "defaultService": "A String", # The full or partial URL to the BackendService resource. This |
| # URL is used if none of the pathRules orrouteRules defined by this PathMatcher are |
| # matched. For example, the |
| # following are all valid URLs to a BackendService resource: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService |
| # - compute/v1/projects/project/global/backendServices/backendService |
| # - global/backendServices/backendService |
| # |
| # |
| # If defaultRouteAction is also specified, advanced |
| # routing actions, such as URL rewrites, take effect before sending the |
| # request to the backend. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Authorization requires one or more of the following Google IAM permissions on the |
| # specified resource default_service: |
| # |
| # |
| # - compute.backendBuckets.use |
| # - compute.backendServices.use |
| "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified pathRules orrouteRules match, the request is redirected to a URL specified |
| # by defaultUrlRedirect. |
| # |
| # |
| # Only one of defaultUrlRedirect, defaultService |
| # or defaultRouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| "description": "A String", # An optional description of this resource. Provide this property when you |
| # create the resource. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backend service. |
| # |
| # HeaderAction specified here are applied after the matchingHttpRouteRule HeaderAction and before theHeaderAction in the UrlMap |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "name": "A String", # The name to which this PathMatcher is referred by theHostRule. |
| "pathRules": [ # The list of path rules. Use this list instead of routeRules |
| # 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 pathRule 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 pathMatcher, only one ofpathRules or routeRules must be set. |
| { # A path-matching rule for a URL. If matched, will use the specifiedBackendService to handle the traffic arriving at this URL. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the PathRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.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 atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "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. |
| "A String", |
| ], |
| "routeAction": { # 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a path rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When a path pattern is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| "routeRules": [ # The list of HTTP route rules. Use this list instead ofpathRules when advanced route matching and routing actions are |
| # desired. routeRules are evaluated in order of priority, from |
| # the lowest to highest number. |
| # |
| # Within a given pathMatcher, you can set only one ofpathRules or routeRules. |
| { # The HttpRouteRule setting specifies how to match an HTTP request |
| # and the corresponding routing action that load balancing proxies perform. |
| "customErrorResponsePolicy": { # Specifies the custom error response policy that must be applied when the # customErrorResponsePolicy specifies how the Load |
| # Balancer returns error responses when BackendServiceorBackendBucket responds with an error. |
| # |
| # If a policy for an |
| # error code is not configured for the RouteRule, a policy for |
| # the error code configured inpathMatcher.defaultCustomErrorResponsePolicy is applied. If |
| # one is not specified inpathMatcher.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 RouteRule for /coming_soon/ is configured for the |
| # error code 404. |
| # |
| # If the request is for www.myotherdomain.com and a404 is encountered, the policy underUrlMap.defaultCustomErrorResponsePolicy takes effect. If a404 response is encountered for the requestwww.example.com/current_events/, the pathMatcher's policy |
| # takes effect. If however, the request forwww.example.com/coming_soon/ encounters a 404, |
| # the policy in RouteRule.customErrorResponsePolicy takes |
| # effect. If any of the requests in this example encounter a 500 |
| # error code, the policy atUrlMap.defaultCustomErrorResponsePolicy takes effect. |
| # |
| # When |
| # used in conjunction withrouteRules.routeAction.retryPolicy, retries take |
| # precedence. Only once all retries are exhausted, thecustomErrorResponsePolicy is applied. While attempting |
| # a retry, if load balancer is successful in reaching the |
| # service, the customErrorResponsePolicy is ignored and |
| # the response from the service is returned to the client. |
| # |
| # customErrorResponsePolicy is supported only for |
| # global external Application Load Balancers. |
| # backend service or backend bucket responds with an error. |
| "errorResponseRules": [ # 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 401 (Un-authorized) code, and another for all 4 series |
| # error codes (4XX). If the backend service returns a401, then the rule for 401 will be applied. |
| # However if the backend service returns a 403, the rule for4xx takes effect. |
| { # 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. |
| "matchResponseCodes": [ # Valid values include: |
| # |
| # |
| # - A number between 400 and 599: For example |
| # 401 or 503, in which case the load balancer |
| # applies the policy if the error code exactly matches this value. |
| # - 5xx: Load Balancer will apply the policy if the |
| # backend service responds with any response code in the range of |
| # 500 to 599. |
| # - 4xx: Load |
| # Balancer will apply the policy if the backend service responds with any |
| # response code in the range of 400 to |
| # 499. |
| # |
| # Values must be unique within matchResponseCodes and across allerrorResponseRules ofCustomErrorResponsePolicy. |
| "A String", |
| ], |
| "overrideResponseCode": 42, # The HTTP status code returned with the response containing the custom |
| # error content. If overrideResponseCode is not supplied, the |
| # same response code returned by the original backend bucket or backend |
| # service is returned to the client. |
| "path": "A String", # The full path to a file within backendBucket . For example:/errors/defaultError.html |
| # |
| # path must start |
| # with a leading slash. path cannot have trailing slashes. |
| # |
| # If the file is not available in backendBucket or the |
| # load balancer cannot reach the BackendBucket, a simpleNot Found Error is returned to the client. |
| # |
| # The value must |
| # be from 1 to 1024 characters |
| }, |
| ], |
| "errorService": "A String", # The full or partial URL to the BackendBucket resource that |
| # contains the custom error content. Examples are: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - compute/v1/projects/project/global/backendBuckets/myBackendBucket |
| # - global/backendBuckets/myBackendBucket |
| # |
| # If errorService is not specified at lower levels likepathMatcher, pathRule and routeRule, |
| # an errorService specified at a higher level in theUrlMap will be used. IfUrlMap.defaultCustomErrorResponsePolicy contains one or moreerrorResponseRules[], it must specifyerrorService. |
| # |
| # If load balancer cannot reach |
| # the backendBucket, a simple Not Found Error will |
| # be returned, with the original response code (oroverrideResponseCode if configured). |
| # |
| # errorService is not supported for internal or regionalHTTP/HTTPS load balancers. |
| }, |
| "description": "A String", # The short description conveying the intent of this routeRule. |
| # |
| # |
| # The description can have a maximum length of 1024 characters. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take effect |
| # for the selected backendService. |
| # |
| # The headerAction value specified here is applied before the |
| # matching pathMatchers[].headerAction and afterpathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction |
| # |
| # HeaderAction is not supported for load balancers |
| # that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "httpFilterConfigs": [ # Outbound route specific configuration fornetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterConfigs only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "httpFilterMetadata": [ # Outbound route specific metadata supplied tonetworkservices.HttpFilter resources enabled by Traffic |
| # Director. httpFilterMetadata only applies for load balancers |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. See ForwardingRule for |
| # more details. |
| # |
| # The only configTypeUrl supported istype.googleapis.com/google.protobuf.Struct |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # HttpFilterConfiguration supplies additional contextual settings |
| # for networkservices.HttpFilter resources enabled by Traffic |
| # Director. |
| "config": "A String", # The configuration needed to enable thenetworkservices.HttpFilter resource. The configuration must be |
| # YAML formatted and only contain fields defined in the protobuf identified |
| # in configTypeUrl |
| "configTypeUrl": "A String", # The fully qualified versioned proto3 type url of the protobuf that the |
| # filter expects for its contextual settings, for example:type.googleapis.com/google.protobuf.Struct |
| "filterName": "A String", # Name of the networkservices.HttpFilter resource this |
| # configuration belongs to. This name must be known to the xDS client. |
| # Example: envoy.wasm |
| }, |
| ], |
| "matchRules": [ # The list of criteria for matching attributes of a request to thisrouteRule. This list has OR semantics: the request matches |
| # this routeRule when any of thematchRules are satisfied. However predicates within |
| # a given matchRule have AND semantics. All predicates |
| # within a matchRule must match for the request to |
| # match the rule. |
| { # HttpRouteRuleMatch specifies a set of criteria for matching |
| # requests to an HttpRouteRule. All specified criteria must |
| # be satisfied for a match to occur. |
| "fullPathMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must exactly match the value specified infullPathMatch after removing any query parameters and anchor |
| # that may be part of the original URL. |
| # |
| # fullPathMatch must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "headerMatches": [ # Specifies a list of header match criteria, all of which must match |
| # corresponding headers in the request. |
| { # matchRule criteria for request header matches. |
| "exactMatch": "A String", # The value should exactly match contents of exactMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "headerName": "A String", # 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 validateForProxyless field set to true, only |
| # non-binary |
| # user-specified custom metadata and the `content-type` header are supported. |
| # The following transport-level headers cannot be used in header matching |
| # rules: |
| # `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, |
| # `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, |
| # `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, |
| # `grpc-timeout` and `grpc-trace-bin`. |
| "invertMatch": True or False, # If set to false, the headerMatch is considered a |
| # match if the preceding match criteria are met. If set to true, |
| # the headerMatch is considered a match if the preceding |
| # match criteria are NOT met. |
| # |
| # The default setting is false. |
| "prefixMatch": "A String", # The value of the header must start with the contents ofprefixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "presentMatch": True or False, # A header with the contents of headerName must exist. The |
| # match takes place whether or not the request's header has a value. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay # The header value must be an integer and its value must be in the range |
| # specified in rangeMatch. If the header does not contain an |
| # integer, number or is empty, the match fails. |
| # |
| # For example for a range [-5, 0] |
| # |
| # |
| # - -3 will match. |
| # - 0 will not match. |
| # - 0.25 will not match. |
| # - -3someString will not match. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # rangeMatch is not supported for load balancers |
| # that have loadBalancingScheme set to EXTERNAL. |
| # within the specified integer range. |
| "rangeEnd": "A String", # The end of the range (exclusive) in signed long integer format. |
| "rangeStart": "A String", # The start of the range (inclusive) in signed long integer format. |
| }, |
| "regexMatch": "A String", # The value of the header must match the regular expression specified inregexMatch. |
| # 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 exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "suffixMatch": "A String", # The value of the header must end with the contents ofsuffixMatch. |
| # |
| # Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set. |
| }, |
| ], |
| "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch |
| # 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. |
| "metadataFilters": [ # 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 metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels 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. |
| # |
| # metadataFilters specified here is applied after those |
| # specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to. |
| # |
| # metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Opaque filter criteria used by load balancers to restrict routing |
| # configuration to a limited set of load balancing proxies. Proxies and |
| # sidecars involved in load balancing would typically present metadata to the |
| # load balancers that need to match criteria specified here. If a match takes |
| # place, the relevant configuration is made available to those |
| # proxies. |
| # |
| # For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least |
| # one of thefilterLabels must match the corresponding label provided in |
| # the metadata. If its filterMatchCriteria is set to |
| # MATCH_ALL, then all of its filterLabels must match with |
| # corresponding labels provided in the metadata. |
| # |
| # An example for using metadataFilters would be: if |
| # load balancing involves |
| # Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers. |
| "filterLabels": [ # The list of label value pairs that must match labels in the provided |
| # metadata based on filterMatchCriteria |
| # |
| # This list must not be empty and can have at the most 64 entries. |
| { # MetadataFilter label name value pairs that are expected |
| # to match corresponding labels presented as metadata to the load balancer. |
| "name": "A String", # Name of metadata label. |
| # |
| # The name can have a maximum length of 1024 characters and must be at |
| # least 1 character long. |
| "value": "A String", # The value of the label must match the specified value. |
| # |
| # value can have a maximum length of 1024 characters. |
| }, |
| ], |
| "filterMatchCriteria": "A String", # Specifies how individual filter label matches |
| # within the list of filterLabels and contributes toward the |
| # overall metadataFilter match. |
| # |
| # Supported values are: |
| # |
| # - MATCH_ANY: at least one of the filterLabels |
| # must have a matching label in the provided metadata. |
| # - MATCH_ALL: all filterLabels must have |
| # matching labels in the provided metadata. |
| }, |
| ], |
| "pathTemplateMatch": "A String", # 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 |
| # |
| # |
| # - The value must be between 1 and 1024 characters |
| # - The pattern must start with a leading slash ("/") |
| # - There may be no more than 5 operators in pattern |
| # |
| # Precisely one ofprefix_match, full_path_match,regex_match or path_template_match must be set. |
| "prefixMatch": "A String", # For satisfying the matchRule condition, the request's |
| # path must begin with the specified prefixMatch.prefixMatch must begin with a /. |
| # |
| # The value must be from 1 to 1024 characters. |
| # |
| # Only one of prefixMatch, fullPathMatch or regexMatch must be |
| # specified. |
| "queryParameterMatches": [ # 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. |
| { # HttpRouteRuleMatch criteria for a request's query parameter. |
| "exactMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter exactly matches the contents of exactMatch. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "name": "A String", # The name of the query parameter to match. The query parameter must exist in |
| # the request, in the absence of which the request match fails. |
| "presentMatch": True or False, # Specifies that the queryParameterMatch matches if the |
| # request contains the query parameter, irrespective of whether the |
| # parameter has a value or not. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| "regexMatch": "A String", # The queryParameterMatch matches if the value of the |
| # parameter matches the regular expression specified byregexMatch. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of presentMatch, exactMatch, orregexMatch must be set. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "regexMatch": "A String", # For satisfying the matchRule condition, the path of the |
| # request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor |
| # supplied with the original URL. For |
| # more information about regular expression syntax, see Syntax. |
| # |
| # Only one of prefixMatch, fullPathMatch orregexMatch must be |
| # specified. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| }, |
| ], |
| "priority": 42, # For routeRules within a given pathMatcher, |
| # priority determines the order in which a load balancer interpretsrouteRules. RouteRules 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. |
| "routeAction": { # In response to a matching matchRule, 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 orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # URL maps for classic Application Load Balancers only support |
| # the urlRewrite action within a route rule'srouteAction. |
| "corsPolicy": { # The specification for allowing client-side cross-origin requests. For more # 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. |
| # information about the W3C recommendation for cross-origin resource sharing |
| # (CORS), see Fetch API Living |
| # Standard. |
| "allowCredentials": True or False, # In response to a preflight request, setting this to true |
| # indicates that |
| # the actual request can include user credentials. This field translates to |
| # the Access-Control-Allow-Credentials header. |
| # |
| # Default is false. |
| "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers |
| # header. |
| "A String", |
| ], |
| "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods |
| # header. |
| "A String", |
| ], |
| "allowOriginRegexes": [ # 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 inallowOrigins or an item inallowOriginRegexes. |
| # |
| # Regular expressions can only be used when the loadBalancingScheme is |
| # set to INTERNAL_SELF_MANAGED. |
| "A String", |
| ], |
| "allowOrigins": [ # Specifies the list of origins that is allowed to do CORS requests. |
| # |
| # An origin is allowed if it matches either an item inallowOrigins or an item inallowOriginRegexes. |
| "A String", |
| ], |
| "disabled": True or False, # If true, disables the CORS policy. |
| # The default value is false, which indicates that the CORS |
| # policy is in effect. |
| "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers |
| # header. |
| "A String", |
| ], |
| "maxAge": 42, # Specifies how long results of a preflight request can be cached in |
| # seconds. This field translates to the Access-Control-Max-Age |
| # header. |
| }, |
| "faultInjectionPolicy": { # The specification for fault injection introduced into traffic to test # 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.timeout and retry_policy is ignored by clients |
| # that are configured with a fault_injection_policy 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. |
| # 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. |
| "abort": { # Specification for how requests are aborted as part of fault injection. # The specification for how client requests are aborted as part of fault |
| # injection. |
| "httpStatus": 42, # 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": 3.14, # 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. |
| }, |
| "delay": { # Specifies the delay introduced by the load balancer before forwarding the # The specification for how client requests are delayed as part of fault |
| # injection, before being sent to a backend service. |
| # request to the backend service as part of fault injection. |
| "fixedDelay": { # A Duration represents a fixed-length span of time represented # Specifies the value of the fixed delay interval. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "percentage": 3.14, # 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. |
| }, |
| }, |
| "maxStreamDuration": { # A Duration represents a fixed-length span of time represented # Specifies the maximum duration (timeout) for streams on the selected route. |
| # Unlike the timeout 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 maximummaxStreamDuration value among all backend services associated |
| # with the route. |
| # |
| # This field is only allowed if the Url map is used with backend services |
| # with loadBalancingScheme set toINTERNAL_SELF_MANAGED. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends # 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-shadow. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has the validateForProxyless field set to true. |
| # 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. |
| "backendService": "A String", # The full or partial URL to the BackendService 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. |
| "mirrorPercent": 3.14, # The percentage of requests to be mirrored to `backend_service`. |
| }, |
| "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. |
| "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. |
| # If not specified, defaults to 1. |
| "perTryTimeout": { # A Duration represents a fixed-length span of time represented # Specifies a non-zero timeout per retry attempt. |
| # |
| # If not specified, will use the timeout set in theHttpRouteAction field. |
| # If timeout in the HttpRouteAction 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "retryConditions": [ # Specifies one or more conditions when this retry policy applies. Valid |
| # values are: |
| # |
| # - 5xx: retry is attempted if the instance or endpoint |
| # responds with any 5xx response code, or if the instance or |
| # endpoint does not respond at all. For example, disconnects, reset, read |
| # timeout, connection failure, and refused streams. |
| # - gateway-error: Similar to 5xx, but only |
| # applies to response codes 502, 503 or504. |
| # - connect-failure: a retry is attempted on failures |
| # connecting to the instance or endpoint. For example, connection |
| # timeouts. |
| # - retriable-4xx: a retry is attempted if the instance |
| # or endpoint responds with a 4xx response code. |
| # The only error that you can retry is error code 409. |
| # - refused-stream: a retry is attempted if the instance |
| # or endpoint resets the stream with a REFUSED_STREAM error |
| # code. This reset type indicates that it is safe to retry. |
| # - cancelled: a retry is attempted if the gRPC status |
| # code in the response header is set to cancelled. |
| # - deadline-exceeded: a retry is attempted if the gRPC |
| # status code in the response header is set todeadline-exceeded. |
| # - internal: a retry is attempted if the gRPC |
| # status code in the response header is set tointernal. |
| # - resource-exhausted: a retry is attempted if the gRPC |
| # status code in the response header is set toresource-exhausted. |
| # - unavailable: a retry is attempted if the gRPC |
| # status code in the response header is set tounavailable. |
| # |
| # Only the following codes are supported when the URL map is bound to |
| # target gRPC proxy that has validateForProxyless field set to true. |
| # |
| # - cancelled |
| # - deadline-exceeded |
| # - internal |
| # - resource-exhausted |
| # - unavailable |
| "A String", |
| ], |
| }, |
| "timeout": { # A Duration represents a fixed-length span of time represented # 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 validateForProxyless field set to true. |
| # as a count of seconds and fractions of seconds at nanosecond |
| # resolution. It is independent of any calendar and concepts like "day" |
| # or "month". Range is approximately 10,000 years. |
| "nanos": 42, # Span of time that's a fraction of a second at nanosecond resolution. |
| # Durations less than one second are represented with a 0 |
| # `seconds` field and a positive `nanos` field. Must be from 0 |
| # to 999,999,999 inclusive. |
| "seconds": "A String", # Span of time at a resolution of a second. Must be from 0 |
| # to 315,576,000,000 inclusive. Note: these bounds are computed from: |
| # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
| }, |
| "urlRewrite": { # The spec for modifying the path before sending the request to the matched # The spec to modify the URL of the request, before forwarding the request |
| # to the matched service. |
| # |
| # urlRewrite 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 validateForProxyless field set to true. |
| # backend service. |
| "hostRewrite": "A String", # Before forwarding the request to the selected service, the request's |
| # host header is replaced with contents of hostRewrite. |
| # |
| # The value must be from 1 to 255 characters. |
| "pathPrefixRewrite": "A String", # Before forwarding the request to the selected backend service, the |
| # matching portion of the request's path is replaced bypathPrefixRewrite. |
| # |
| # The value must be from 1 to 1024 characters. |
| "pathTemplateRewrite": "A String", # If specified, the pattern rewrites the URL path (based on the :path |
| # header) using the HTTP template syntax. |
| # |
| # A corresponding |
| # path_template_match must be specified. Any template variables must exist in |
| # the path_template_match field. |
| # |
| # |
| # - -At least one variable must be specified in the path_template_match |
| # field |
| # - You can omit variables from the rewritten URL |
| # - The * and ** operators cannot be matched |
| # unless they have a corresponding variable name - e.g. |
| # {format=*} or {var=**}. |
| # |
| # For example, a path_template_match of /static/{format=**} |
| # could be rewritten as /static/content/{format} to prefix/content to the URL. Variables can also be re-ordered in a |
| # rewrite, so that /{country}/{format}/{suffix=**} can be |
| # rewritten as /content/{format}/{country}/{suffix}. |
| # |
| # At least |
| # one non-empty routeRules[].matchRules[].path_template_match is |
| # required. |
| # |
| # Only one of path_prefix_rewrite orpath_template_rewrite may be specified. |
| }, |
| "weightedBackendServices": [ # 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 backend service. If all traffic needs to |
| # go to a single backend service, there must be oneweightedBackendService 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 HttpRouteAction. |
| { # 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 |
| "backendService": "A String", # The full or partial URL to the default BackendService |
| # resource. Before |
| # forwarding the request to backendService, the load balancer |
| # applies any relevant headerActions specified as part of thisbackendServiceWeight. |
| "headerAction": { # The request and response header transformations that take effect before # Specifies changes to request and response headers that need to take |
| # effect for the selected backendService. |
| # |
| # headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap. |
| # |
| # headerAction is not supported for load balancers that have |
| # their loadBalancingScheme set to EXTERNAL. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| # the request is passed along to the selected backendService. |
| "requestHeadersToAdd": [ # Headers to add to a matching request before forwarding the request to thebackendService. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # request before forwarding the request to the backendService. |
| "A String", |
| ], |
| "responseHeadersToAdd": [ # Headers to add the response before sending the response back to the |
| # client. |
| { # Specification determining how headers are added to requests or responses. |
| "headerName": "A String", # The name of the header. |
| "headerValue": "A String", # The value of the header to add. |
| "replace": True or False, # If false, headerValue is appended to any values |
| # that already |
| # exist for the header. If true, headerValue is set for the |
| # header, discarding any values that were set for that header. |
| # |
| # The default value is true, |
| # unless a variable is present in headerValue, |
| # in which case the default value is false. |
| # . |
| }, |
| ], |
| "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the |
| # response before sending the response back to the client. |
| "A String", |
| ], |
| }, |
| "weight": 42, # Specifies the fraction of traffic sent to a backend service, |
| # computed asweight / (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 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. |
| }, |
| ], |
| }, |
| "service": "A String", # 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 orrouteAction.weightedBackendService can be set. |
| "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL |
| # specified by urlRedirect. |
| # |
| # |
| # Only one of urlRedirect, service orrouteAction.weightedBackendService can be set. |
| # |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy. |
| "hostRedirect": "A String", # 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. |
| "httpsRedirect": True or False, # If set to true, the URL scheme in the redirected request is |
| # set to HTTPS. |
| # If set to false, the URL scheme of the redirected request |
| # remains the same as that of the request. |
| # |
| # This must only be set for URL maps used inTargetHttpProxys. Setting this true forTargetHttpsProxy is not permitted. |
| # |
| # The default is set to false. |
| "pathRedirect": "A String", # The path that is used in the redirect response instead of the one |
| # that was supplied in the request. |
| # |
| # pathRedirect cannot be supplied together withprefixRedirect. 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. |
| "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in |
| # the HttpRouteRuleMatch, retaining the remaining portion |
| # of the URL before redirecting the request. |
| # |
| # prefixRedirect cannot be supplied together withpathRedirect. 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. |
| "redirectResponseCode": "A String", # The HTTP Status code to use for this RedirectAction. |
| # |
| # Supported values are: |
| # |
| # - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds |
| # to 301. |
| # - FOUND, which corresponds to 302. |
| # - SEE_OTHER which corresponds to 303. |
| # - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request |
| # method is retained. |
| # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request |
| # method is retained. |
| "stripQuery": True or False, # If set to true, any accompanying query portion of the original |
| # URL is |
| # removed before redirecting the request. If set to false, the |
| # query portion of the original URL is retained. |
| # |
| # The default is set to false. |
| }, |
| }, |
| ], |
| }, |
| ], |
| "region": "A String", # [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. |
| "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| "tests": [ # The list of expected URL mapping tests. Request to update theUrlMap succeeds only if all test cases pass. You can specify a |
| # maximum of 100 tests per UrlMap. |
| # |
| # Not supported when the URL map is bound to a target gRPC proxy that |
| # has validateForProxyless field set to true. |
| { # Message for the expected URL mappings. |
| "backendServiceWeight": 42, # The weight to use for the supplied host and path when using advanced |
| # routing rules that involve traffic splitting. |
| "description": "A String", # Description of this test case. |
| "expectedOutputUrl": "A String", # 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 whenexpectedOutputUrl matches the request forwarded by |
| # the load balancer to backends. For rules with urlRewrite, |
| # the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored. |
| # |
| # For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer's |
| # redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. |
| # If urlRedirect specifies strip_query, the test |
| # passes only if expectedOutputUrl does not contain any query |
| # parameters. |
| # |
| # expectedOutputUrl is optional whenservice is specified. |
| "expectedRedirectResponseCode": 42, # For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in |
| # load balancer's redirect response. |
| # |
| # expectedRedirectResponseCode cannot be set whenservice is set. |
| "expectedUrlRedirect": "A String", # The expected URL that should be redirected to for the host and path |
| # being tested. |
| # [Deprecated] This field is deprecated. |
| # Use expected_output_url instead. |
| "headers": [ # HTTP headers for this request. If headers contains |
| # a host header, then host must also match the header value. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. If headers contains a host header, |
| # then host must also match the header value. |
| "path": "A String", # Path portion of the URL. |
| "service": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| # |
| # The service field cannot |
| # be set if expectedRedirectResponseCode is set. |
| }, |
| ], |
| }, |
| } |
| |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { |
| "result": { # Message representing the validation result for a UrlMap. |
| "loadErrors": [ |
| "A String", |
| ], |
| "loadSucceeded": True or False, # Whether the given UrlMap can be successfully loaded. |
| # If false, 'loadErrors' indicates the reasons. |
| "testFailures": [ |
| { |
| "actualOutputUrl": "A String", # The actual output URL evaluated by a load balancer containing the scheme, |
| # host, path and query parameters. |
| "actualRedirectResponseCode": 42, # Actual HTTP status code for rule with `urlRedirect` |
| # calculated by load balancer |
| "actualService": "A String", # BackendService or BackendBucket returned by load |
| # balancer. |
| "expectedOutputUrl": "A String", # The expected output URL evaluated by a load balancer containing the scheme, |
| # host, path and query parameters. |
| "expectedRedirectResponseCode": 42, # Expected HTTP status code for rule with `urlRedirect` |
| # calculated by load balancer |
| "expectedService": "A String", # Expected BackendService or BackendBucket resource |
| # the given URL should be mapped to. |
| "headers": [ # HTTP headers of the request. |
| { # HTTP headers used in UrlMapTests. |
| "name": "A String", # Header name. |
| "value": "A String", # Header value. |
| }, |
| ], |
| "host": "A String", # Host portion of the URL. |
| "path": "A String", # Path portion including query parameters in the URL. |
| }, |
| ], |
| "testPassed": True or False, # If successfully loaded, this field indicates whether the test passed. |
| # If false, 'testFailures's indicate the reason of failure. |
| }, |
| }</pre> |
| </div> |
| |
| </body></html> |