aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)
Retrieves the list of all UrlMap resources, regional and global, available to the specified project.
aggregatedList_next(previous_request, previous_response)
Retrieves the next page of results.
delete(project, urlMap, requestId=None)
Deletes the specified UrlMap resource.
Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.
insert(project, body, requestId=None)
Creates a UrlMap resource in the specified project using the data included in the request.
invalidateCache(project, urlMap, body, requestId=None)
Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)
Retrieves the list of UrlMap resources available to the specified project.
list_next(previous_request, previous_response)
Retrieves the next page of results.
patch(project, urlMap, body, requestId=None)
Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
testIamPermissions(project, resource, body)
Returns permissions that a caller has on the specified resource.
update(project, urlMap, body, requestId=None)
Updates the specified UrlMap resource with the data included in the request.
validate(project, urlMap, body)
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.
aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)
Retrieves the list of all UrlMap resources, regional and global, available to the specified project. Args: project: string, Name of the project scoping this request. (required) 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. 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) 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. filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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. 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 on resource 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). Returns: An object of the form: { "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 than maxResults, 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. "kind": "compute#urlMapsAggregatedList", # Type of resource. "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. { # A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for url maps. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. "tests": [ # The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. { # Message for the expected URL mappings. "path": "A String", # Path portion of the URL. "host": "A String", # Host portion of the URL. "description": "A String", # Description of this test case. "service": "A String", # Expected BackendService resource the given URL should be mapped to. }, ], "selfLink": "A String", # [Output Only] Server-defined URL for 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 will be 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. "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 will be used. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "defaultService": "A String", # The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules 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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must 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 "routeRules": [ # The list of ordered HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. The order of specifying routeRules matters: the first rule that matches will cause its specified routing action to take effect. # Only one of pathRules or routeRules must be set. { # An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of urlRedirect, service or routeAction.weightedBackendService must be set. "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL specified by urlRedirect. # If urlRedirect is specified, service or routeAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "routeAction": { # In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. # Only one of routeAction or urlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "matchRules": [ { # HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. "regexMatch": "A String", # For satifying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # 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. "regexMatch": "A String", # The value of the header must match the regualar expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript # 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. "invertMatch": True or False, # If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. # The default setting is false. "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". "prefixMatch": "A String", # The value of the header must start with the contents of prefixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "suffixMatch": "A String", # The value of the header must end with the contents of suffixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "exactMatch": "A String", # The value should exactly match contents of exactMatch. # 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 or not. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. # 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. "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. }, }, ], "fullPathMatch": "A String", # For satifying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. # FullPathMatch must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "prefixMatch": "A String", # For satifying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. # The value must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch matches are case sensitive. # The default value is false. # caseSensitive must not be used with regexMatch. "metadataFilters": [ # Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # metadataFilters specified here can be overrides those specified in ForwardingRule that refers to this UrlMap. # metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. { # Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When when none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "name": "A String", # The name to which this PathMatcher is referred by the HostRule. }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here take effect after headerAction specified under pathMatcher. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 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. "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "hostRules": [ # The list of HostRules to use against the URL. { # UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. "hosts": [ # The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. "A String", ], "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "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. }, ], "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 with RFC1035. 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. }, ], "warning": { # Informational warning which replaces the list of backend services when the list is empty. "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, }, }, "warning": { # [Output Only] Informational warning message. "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. "selfLink": "A String", # [Output Only] Server-defined URL for this resource. }
aggregatedList_next(previous_request, previous_response)
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.
delete(project, urlMap, requestId=None)
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). Returns: An object of the form: { # Represents an Operation resource. # # You can use an operation resource to manage asynchronous API requests. For more information, read Handling 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 zonalOperations resource. # # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. "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. "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. "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. "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. "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. { "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, ], "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. "name": "A String", # [Output Only] Name of the resource. "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. "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. { "message": "A String", # [Output Only] An optional, human-readable error message. "code": "A String", # [Output Only] The error type identifier for this error. "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. }, ], }, "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. "selfLink": "A String", # [Output Only] Server-defined URL for the 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 persistent disk that the snapshot was created from. }
get(project, urlMap)
Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. Args: project: string, Project ID for this request. (required) urlMap: string, Name of the UrlMap resource to return. (required) Returns: An object of the form: { # A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for url maps. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. "tests": [ # The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. { # Message for the expected URL mappings. "path": "A String", # Path portion of the URL. "host": "A String", # Host portion of the URL. "description": "A String", # Description of this test case. "service": "A String", # Expected BackendService resource the given URL should be mapped to. }, ], "selfLink": "A String", # [Output Only] Server-defined URL for 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 will be 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. "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 will be used. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "defaultService": "A String", # The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules 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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must 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 "routeRules": [ # The list of ordered HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. The order of specifying routeRules matters: the first rule that matches will cause its specified routing action to take effect. # Only one of pathRules or routeRules must be set. { # An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of urlRedirect, service or routeAction.weightedBackendService must be set. "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL specified by urlRedirect. # If urlRedirect is specified, service or routeAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "routeAction": { # In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. # Only one of routeAction or urlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "matchRules": [ { # HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. "regexMatch": "A String", # For satifying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # 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. "regexMatch": "A String", # The value of the header must match the regualar expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript # 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. "invertMatch": True or False, # If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. # The default setting is false. "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". "prefixMatch": "A String", # The value of the header must start with the contents of prefixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "suffixMatch": "A String", # The value of the header must end with the contents of suffixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "exactMatch": "A String", # The value should exactly match contents of exactMatch. # 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 or not. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. # 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. "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. }, }, ], "fullPathMatch": "A String", # For satifying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. # FullPathMatch must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "prefixMatch": "A String", # For satifying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. # The value must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch matches are case sensitive. # The default value is false. # caseSensitive must not be used with regexMatch. "metadataFilters": [ # Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # metadataFilters specified here can be overrides those specified in ForwardingRule that refers to this UrlMap. # metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. { # Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When when none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "name": "A String", # The name to which this PathMatcher is referred by the HostRule. }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here take effect after headerAction specified under pathMatcher. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 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. "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "hostRules": [ # The list of HostRules to use against the URL. { # UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. "hosts": [ # The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. "A String", ], "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "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. }, ], "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 with RFC1035. 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. }
insert(project, body, requestId=None)
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. (required) The object takes the form of: { # A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for url maps. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. "tests": [ # The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. { # Message for the expected URL mappings. "path": "A String", # Path portion of the URL. "host": "A String", # Host portion of the URL. "description": "A String", # Description of this test case. "service": "A String", # Expected BackendService resource the given URL should be mapped to. }, ], "selfLink": "A String", # [Output Only] Server-defined URL for 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 will be 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. "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 will be used. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "defaultService": "A String", # The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules 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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must 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 "routeRules": [ # The list of ordered HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. The order of specifying routeRules matters: the first rule that matches will cause its specified routing action to take effect. # Only one of pathRules or routeRules must be set. { # An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of urlRedirect, service or routeAction.weightedBackendService must be set. "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL specified by urlRedirect. # If urlRedirect is specified, service or routeAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "routeAction": { # In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. # Only one of routeAction or urlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "matchRules": [ { # HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. "regexMatch": "A String", # For satifying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # 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. "regexMatch": "A String", # The value of the header must match the regualar expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript # 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. "invertMatch": True or False, # If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. # The default setting is false. "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". "prefixMatch": "A String", # The value of the header must start with the contents of prefixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "suffixMatch": "A String", # The value of the header must end with the contents of suffixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "exactMatch": "A String", # The value should exactly match contents of exactMatch. # 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 or not. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. # 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. "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. }, }, ], "fullPathMatch": "A String", # For satifying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. # FullPathMatch must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "prefixMatch": "A String", # For satifying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. # The value must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch matches are case sensitive. # The default value is false. # caseSensitive must not be used with regexMatch. "metadataFilters": [ # Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # metadataFilters specified here can be overrides those specified in ForwardingRule that refers to this UrlMap. # metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. { # Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When when none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "name": "A String", # The name to which this PathMatcher is referred by the HostRule. }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here take effect after headerAction specified under pathMatcher. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 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. "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "hostRules": [ # The list of HostRules to use against the URL. { # UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. "hosts": [ # The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. "A String", ], "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "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. }, ], "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 with RFC1035. 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. } 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). Returns: An object of the form: { # Represents an Operation resource. # # You can use an operation resource to manage asynchronous API requests. For more information, read Handling 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 zonalOperations resource. # # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. "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. "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. "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. "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. "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. { "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, ], "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. "name": "A String", # [Output Only] Name of the resource. "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. "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. { "message": "A String", # [Output Only] An optional, human-readable error message. "code": "A String", # [Output Only] The error type identifier for this error. "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. }, ], }, "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. "selfLink": "A String", # [Output Only] Server-defined URL for the 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 persistent disk that the snapshot was created from. }
invalidateCache(project, urlMap, body, requestId=None)
Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. Args: project: string, Project ID for this request. (required) urlMap: string, Name of the UrlMap scoping this request. (required) body: object, The request body. (required) The object takes the form of: { "path": "A String", "host": "A String", # If set, this invalidation rule will only apply to requests with a Host header matching host. } 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). Returns: An object of the form: { # Represents an Operation resource. # # You can use an operation resource to manage asynchronous API requests. For more information, read Handling 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 zonalOperations resource. # # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. "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. "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. "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. "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. "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. { "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, ], "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. "name": "A String", # [Output Only] Name of the resource. "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. "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. { "message": "A String", # [Output Only] An optional, human-readable error message. "code": "A String", # [Output Only] The error type identifier for this error. "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. }, ], }, "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. "selfLink": "A String", # [Output Only] Server-defined URL for the 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 persistent disk that the snapshot was created from. }
list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)
Retrieves the list of UrlMap resources available to the specified project. Args: project: string, Project ID for this request. (required) 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. 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) 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. filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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. 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 on resource 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). Returns: An object of the form: { # Contains a list of UrlMap resources. "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 than maxResults, 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. "kind": "compute#urlMapList", # Type of resource. "items": [ # A list of UrlMap resources. { # A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for url maps. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. "tests": [ # The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. { # Message for the expected URL mappings. "path": "A String", # Path portion of the URL. "host": "A String", # Host portion of the URL. "description": "A String", # Description of this test case. "service": "A String", # Expected BackendService resource the given URL should be mapped to. }, ], "selfLink": "A String", # [Output Only] Server-defined URL for 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 will be 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. "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 will be used. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "defaultService": "A String", # The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules 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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must 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 "routeRules": [ # The list of ordered HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. The order of specifying routeRules matters: the first rule that matches will cause its specified routing action to take effect. # Only one of pathRules or routeRules must be set. { # An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of urlRedirect, service or routeAction.weightedBackendService must be set. "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL specified by urlRedirect. # If urlRedirect is specified, service or routeAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "routeAction": { # In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. # Only one of routeAction or urlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "matchRules": [ { # HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. "regexMatch": "A String", # For satifying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # 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. "regexMatch": "A String", # The value of the header must match the regualar expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript # 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. "invertMatch": True or False, # If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. # The default setting is false. "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". "prefixMatch": "A String", # The value of the header must start with the contents of prefixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "suffixMatch": "A String", # The value of the header must end with the contents of suffixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "exactMatch": "A String", # The value should exactly match contents of exactMatch. # 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 or not. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. # 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. "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. }, }, ], "fullPathMatch": "A String", # For satifying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. # FullPathMatch must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "prefixMatch": "A String", # For satifying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. # The value must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch matches are case sensitive. # The default value is false. # caseSensitive must not be used with regexMatch. "metadataFilters": [ # Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # metadataFilters specified here can be overrides those specified in ForwardingRule that refers to this UrlMap. # metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. { # Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When when none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "name": "A String", # The name to which this PathMatcher is referred by the HostRule. }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here take effect after headerAction specified under pathMatcher. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 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. "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "hostRules": [ # The list of HostRules to use against the URL. { # UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. "hosts": [ # The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. "A String", ], "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "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. }, ], "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 with RFC1035. 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. }, ], "warning": { # [Output Only] Informational warning message. "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. "selfLink": "A String", # [Output Only] Server-defined URL for this resource. }
list_next(previous_request, previous_response)
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.
patch(project, urlMap, body, requestId=None)
Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON 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. (required) The object takes the form of: { # A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for url maps. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. "tests": [ # The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. { # Message for the expected URL mappings. "path": "A String", # Path portion of the URL. "host": "A String", # Host portion of the URL. "description": "A String", # Description of this test case. "service": "A String", # Expected BackendService resource the given URL should be mapped to. }, ], "selfLink": "A String", # [Output Only] Server-defined URL for 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 will be 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. "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 will be used. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "defaultService": "A String", # The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules 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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must 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 "routeRules": [ # The list of ordered HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. The order of specifying routeRules matters: the first rule that matches will cause its specified routing action to take effect. # Only one of pathRules or routeRules must be set. { # An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of urlRedirect, service or routeAction.weightedBackendService must be set. "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL specified by urlRedirect. # If urlRedirect is specified, service or routeAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "routeAction": { # In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. # Only one of routeAction or urlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "matchRules": [ { # HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. "regexMatch": "A String", # For satifying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # 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. "regexMatch": "A String", # The value of the header must match the regualar expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript # 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. "invertMatch": True or False, # If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. # The default setting is false. "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". "prefixMatch": "A String", # The value of the header must start with the contents of prefixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "suffixMatch": "A String", # The value of the header must end with the contents of suffixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "exactMatch": "A String", # The value should exactly match contents of exactMatch. # 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 or not. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. # 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. "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. }, }, ], "fullPathMatch": "A String", # For satifying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. # FullPathMatch must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "prefixMatch": "A String", # For satifying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. # The value must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch matches are case sensitive. # The default value is false. # caseSensitive must not be used with regexMatch. "metadataFilters": [ # Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # metadataFilters specified here can be overrides those specified in ForwardingRule that refers to this UrlMap. # metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. { # Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When when none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "name": "A String", # The name to which this PathMatcher is referred by the HostRule. }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here take effect after headerAction specified under pathMatcher. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 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. "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "hostRules": [ # The list of HostRules to use against the URL. { # UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. "hosts": [ # The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. "A String", ], "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "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. }, ], "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 with RFC1035. 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. } 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). Returns: An object of the form: { # Represents an Operation resource. # # You can use an operation resource to manage asynchronous API requests. For more information, read Handling 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 zonalOperations resource. # # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. "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. "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. "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. "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. "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. { "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, ], "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. "name": "A String", # [Output Only] Name of the resource. "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. "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. { "message": "A String", # [Output Only] An optional, human-readable error message. "code": "A String", # [Output Only] The error type identifier for this error. "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. }, ], }, "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. "selfLink": "A String", # [Output Only] Server-defined URL for the 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 persistent disk that the snapshot was created from. }
testIamPermissions(project, resource, body)
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. (required) 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", ], } Returns: An object of the form: { "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. "A String", ], }
update(project, urlMap, body, requestId=None)
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. (required) The object takes the form of: { # A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for url maps. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. "tests": [ # The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. { # Message for the expected URL mappings. "path": "A String", # Path portion of the URL. "host": "A String", # Host portion of the URL. "description": "A String", # Description of this test case. "service": "A String", # Expected BackendService resource the given URL should be mapped to. }, ], "selfLink": "A String", # [Output Only] Server-defined URL for 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 will be 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. "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 will be used. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "defaultService": "A String", # The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules 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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must 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 "routeRules": [ # The list of ordered HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. The order of specifying routeRules matters: the first rule that matches will cause its specified routing action to take effect. # Only one of pathRules or routeRules must be set. { # An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of urlRedirect, service or routeAction.weightedBackendService must be set. "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL specified by urlRedirect. # If urlRedirect is specified, service or routeAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "routeAction": { # In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. # Only one of routeAction or urlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "matchRules": [ { # HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. "regexMatch": "A String", # For satifying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # 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. "regexMatch": "A String", # The value of the header must match the regualar expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript # 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. "invertMatch": True or False, # If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. # The default setting is false. "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". "prefixMatch": "A String", # The value of the header must start with the contents of prefixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "suffixMatch": "A String", # The value of the header must end with the contents of suffixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "exactMatch": "A String", # The value should exactly match contents of exactMatch. # 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 or not. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. # 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. "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. }, }, ], "fullPathMatch": "A String", # For satifying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. # FullPathMatch must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "prefixMatch": "A String", # For satifying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. # The value must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch matches are case sensitive. # The default value is false. # caseSensitive must not be used with regexMatch. "metadataFilters": [ # Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # metadataFilters specified here can be overrides those specified in ForwardingRule that refers to this UrlMap. # metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. { # Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When when none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "name": "A String", # The name to which this PathMatcher is referred by the HostRule. }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here take effect after headerAction specified under pathMatcher. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 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. "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "hostRules": [ # The list of HostRules to use against the URL. { # UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. "hosts": [ # The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. "A String", ], "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "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. }, ], "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 with RFC1035. 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. } 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). Returns: An object of the form: { # Represents an Operation resource. # # You can use an operation resource to manage asynchronous API requests. For more information, read Handling 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 zonalOperations resource. # # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. "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. "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. "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. "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. "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. { "message": "A String", # [Output Only] A human-readable description of the warning code. "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" } { "value": "A String", # [Output Only] A warning data value corresponding to the key. "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). }, ], }, ], "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. "name": "A String", # [Output Only] Name of the resource. "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. "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. { "message": "A String", # [Output Only] An optional, human-readable error message. "code": "A String", # [Output Only] The error type identifier for this error. "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. }, ], }, "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. "selfLink": "A String", # [Output Only] Server-defined URL for the 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 persistent disk that the snapshot was created from. }
validate(project, urlMap, body)
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. (required) The object takes the form of: { "resource": { # A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. # Content of the UrlMap to be validated. "kind": "compute#urlMap", # [Output Only] Type of the resource. Always compute#urlMaps for url maps. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. "tests": [ # The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. { # Message for the expected URL mappings. "path": "A String", # Path portion of the URL. "host": "A String", # Host portion of the URL. "description": "A String", # Description of this test case. "service": "A String", # Expected BackendService resource the given URL should be mapped to. }, ], "selfLink": "A String", # [Output Only] Server-defined URL for 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 will be 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. "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 will be used. "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "defaultRouteAction": { # defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. # Only one of defaultRouteAction or defaultUrlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "defaultService": "A String", # The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules 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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. # Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must 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 "routeRules": [ # The list of ordered HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. The order of specifying routeRules matters: the first rule that matches will cause its specified routing action to take effect. # Only one of pathRules or routeRules must be set. { # An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "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 additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. # Only one of urlRedirect, service or routeAction.weightedBackendService must be set. "urlRedirect": { # Specifies settings for an HTTP redirect. # When this rule is matched, the request is redirected to a URL specified by urlRedirect. # If urlRedirect is specified, service or routeAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "routeAction": { # In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. # Only one of routeAction or urlRedirect must be set. "requestMirrorPolicy": { # A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. # Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. "backendService": "A String", # The full or partial URL to the BackendService resource being mirrored to. }, "retryPolicy": { # The retry policy associates with HttpRouteRule # Specifies the retry policy associated with this route. "perTryTimeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies a non-zero timeout per retry attempt. "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": [ # Specfies one or more conditions when this retry rule applies. Valid values are: # - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. # - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. # - # - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. # - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. # - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. # - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled # - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded # - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted # - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable "A String", ], "numRetries": 42, # Specifies the allowed number retries. This number must be > 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, "matchRules": [ { # HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. "regexMatch": "A String", # For satifying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # 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. "regexMatch": "A String", # The value of the header must match the regualar expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript # 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. "invertMatch": True or False, # If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. # The default setting is false. "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". "prefixMatch": "A String", # The value of the header must start with the contents of prefixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "suffixMatch": "A String", # The value of the header must end with the contents of suffixMatch. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "exactMatch": "A String", # The value should exactly match contents of exactMatch. # 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 or not. # Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. "rangeMatch": { # HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. # 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. "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. }, }, ], "fullPathMatch": "A String", # For satifying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. # FullPathMatch must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "prefixMatch": "A String", # For satifying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. # The value must be between 1 and 1024 characters. # Only one of prefixMatch, fullPathMatch or regexMatch must be specified. "ignoreCase": True or False, # Specifies that prefixMatch and fullPathMatch matches are case sensitive. # The default value is false. # caseSensitive must not be used with regexMatch. "metadataFilters": [ # Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # metadataFilters specified here can be overrides those specified in ForwardingRule that refers to this UrlMap. # metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. { # Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant routing configuration is made available to those proxies. # For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels 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 in the provided metadata. # An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in 0. }, "faultInjectionPolicy": { # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # 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 Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. # timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. "delay": { # Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. # The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "fixedDelay": { # A Duration represents a fixed-length span of time represented 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. # Specifies the value of the fixed delay interval. "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 }, }, "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. "percentage": 3.14, # The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. # The value must be between 0.0 and 100.0 inclusive. "httpStatus": 42, # The HTTP status code used to abort the request. # The value must be between 200 and 599 inclusive. }, }, "corsPolicy": { # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing # The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing "allowMethods": [ # Specifies the content for the Access-Control-Allow-Methods header. "A String", ], "allowOrigins": [ # Specifies the list of origins that will be allowed to do CORS requests. # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "allowOriginRegexes": [ # Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript # An origin is allowed if it matches either allow_origins or allow_origin_regex. "A String", ], "maxAge": 42, # Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header. "allowCredentials": True or False, # In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. # Default is false. "disabled": True or False, # If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. "allowHeaders": [ # Specifies the content for the Access-Control-Allow-Headers header. "A String", ], "exposeHeaders": [ # Specifies the content for the Access-Control-Expose-Headers header. "A String", ], }, "timeout": { # A Duration represents a fixed-length span of time represented 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. # Specifies the timeout for the selected route. Timeout is computed from the time the request is has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. # If not specified, the default value is 15 seconds. "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 }, "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 one weightedBackendService with weight set to a non 0 number. # Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like 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 BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "weight": 42, # Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . # The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. # The value must be between 0 and 1000 "backendService": "A String", # The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. }, ], "urlRewrite": { # The spec for modifying the path before sending the request to the matched backend service. # The spec to modify the URL of the request, prior to forwarding the request to the matched service "hostRewrite": "A String", # Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. # The value must be between 1 and 255 characters. "pathPrefixRewrite": "A String", # Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. # The value must be between 1 and 1024 characters. }, }, }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 false. }, ], }, "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When when none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "name": "A String", # The name to which this PathMatcher is referred by the HostRule. }, ], "headerAction": { # The request and response header transformations that take effect before the request is passed along to the selected backendService. # Specifies changes to request and response headers that need to take effect for the selected backendService. # The headerAction specified here take effect after headerAction specified under pathMatcher. "requestHeadersToRemove": [ # A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. "A String", ], "responseHeadersToRemove": [ # A list of header names for headers that need to be removed from the response prior to sending the response back to the client. "A String", ], "requestHeadersToAdd": [ # Headers to add to a matching request prior to forwarding the request to the backendService. { # 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 false. }, ], "responseHeadersToAdd": [ # Headers to add the response prior to 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 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. "defaultUrlRedirect": { # Specifies settings for an HTTP redirect. # When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. # If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. "pathRedirect": "A String", # The path that will be used in the redirect response instead of the one that was supplied in the request. # Only one of pathRedirect or prefixRedirect must be specified. # The value must be between 1 and 1024 characters. "stripQuery": True or False, # If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. # The default is set to false. "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 will be retained. # - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. "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 will remain the same as that of the request. # This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. # The default is set to false. "prefixRedirect": "A String", # The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. "hostRedirect": "A String", # The host that will be used in the redirect response instead of the one that was supplied in the request. # The value must be between 1 and 255 characters. }, "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. "hostRules": [ # The list of HostRules to use against the URL. { # UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. "hosts": [ # The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. "A String", ], "description": "A String", # An optional description of this resource. Provide this property when you create the resource. "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. }, ], "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 with RFC1035. 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. }, } Returns: An object of the form: { "result": { # Message representing the validation result for a UrlMap. "testFailures": [ { "path": "A String", "actualService": "A String", "host": "A String", "expectedService": "A String", }, ], "loadErrors": [ "A String", ], "testPassed": True or False, # If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. "loadSucceeded": True or False, # Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. }, }