- HTTP request
- Path parameters
- Request body
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- JSON representation
- Response body
- Authorization Scopes
- IAM Permissions
- Examples
- Try it!
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.
HTTP request
POST https://compute.googleapis.com/compute/beta/projects/{project}/regions/{region}/urlMaps/{resourceId}/validate
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
Project ID for this request. |
region |
Name of the region scoping this request. |
resourceId |
Name of the UrlMap resource to be validated as. |
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{ "resource": { "id": string, "creationTimestamp": string, "name": string, "description": string, "selfLink": string, "hostRules": [ { "description": string, "hosts": [ string ], "pathMatcher": string } ], "pathMatchers": [ { "name": string, "description": string, "defaultService": string, "defaultRouteAction": { "weightedBackendServices": [ { "backendService": string, "weight": integer, "headerAction": { "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ], "responseHeadersToRemove": [ string ], "responseHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ] } } ], "urlRewrite": { "pathPrefixRewrite": string, "hostRewrite": string }, "timeout": { "seconds": string, "nanos": integer }, "retryPolicy": { "retryConditions": [ string ], "numRetries": integer, "perTryTimeout": { "seconds": string, "nanos": integer } }, "requestMirrorPolicy": { "backendService": string }, "corsPolicy": { "allowOrigins": [ string ], "allowOriginRegexes": [ string ], "allowMethods": [ string ], "allowHeaders": [ string ], "exposeHeaders": [ string ], "maxAge": integer, "allowCredentials": boolean, "disabled": boolean }, "faultInjectionPolicy": { "delay": { "fixedDelay": { "seconds": string, "nanos": integer }, "percentage": number }, "abort": { "httpStatus": integer, "percentage": number } } }, "defaultUrlRedirect": { "hostRedirect": string, "pathRedirect": string, "prefixRedirect": string, "redirectResponseCode": enum, "httpsRedirect": boolean, "stripQuery": boolean }, "pathRules": [ { "service": string, "routeAction": { "weightedBackendServices": [ { "backendService": string, "weight": integer, "headerAction": { "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ], "responseHeadersToRemove": [ string ], "responseHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ] } } ], "urlRewrite": { "pathPrefixRewrite": string, "hostRewrite": string }, "timeout": { "seconds": string, "nanos": integer }, "retryPolicy": { "retryConditions": [ string ], "numRetries": integer, "perTryTimeout": { "seconds": string, "nanos": integer } }, "requestMirrorPolicy": { "backendService": string }, "corsPolicy": { "allowOrigins": [ string ], "allowOriginRegexes": [ string ], "allowMethods": [ string ], "allowHeaders": [ string ], "exposeHeaders": [ string ], "maxAge": integer, "allowCredentials": boolean, "disabled": boolean }, "faultInjectionPolicy": { "delay": { "fixedDelay": { "seconds": string, "nanos": integer }, "percentage": number }, "abort": { "httpStatus": integer, "percentage": number } } }, "urlRedirect": { "hostRedirect": string, "pathRedirect": string, "prefixRedirect": string, "redirectResponseCode": enum, "httpsRedirect": boolean, "stripQuery": boolean }, "paths": [ string ] } ], "routeRules": [ { "priority": integer, "description": string, "matchRules": [ { "prefixMatch": string, "fullPathMatch": string, "regexMatch": string, "ignoreCase": boolean, "headerMatches": [ { "headerName": string, "exactMatch": string, "regexMatch": string, "rangeMatch": { "rangeStart": string, "rangeEnd": string }, "presentMatch": boolean, "prefixMatch": string, "suffixMatch": string, "invertMatch": boolean } ], "queryParameterMatches": [ { "name": string, "presentMatch": boolean, "exactMatch": string, "regexMatch": string } ], "metadataFilters": [ { "filterMatchCriteria": enum, "filterLabels": [ { "name": string, "value": string } ] } ] } ], "service": string, "routeAction": { "weightedBackendServices": [ { "backendService": string, "weight": integer, "headerAction": { "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ], "responseHeadersToRemove": [ string ], "responseHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ] } } ], "urlRewrite": { "pathPrefixRewrite": string, "hostRewrite": string }, "timeout": { "seconds": string, "nanos": integer }, "retryPolicy": { "retryConditions": [ string ], "numRetries": integer, "perTryTimeout": { "seconds": string, "nanos": integer } }, "requestMirrorPolicy": { "backendService": string }, "corsPolicy": { "allowOrigins": [ string ], "allowOriginRegexes": [ string ], "allowMethods": [ string ], "allowHeaders": [ string ], "exposeHeaders": [ string ], "maxAge": integer, "allowCredentials": boolean, "disabled": boolean }, "faultInjectionPolicy": { "delay": { "fixedDelay": { "seconds": string, "nanos": integer }, "percentage": number }, "abort": { "httpStatus": integer, "percentage": number } } }, "urlRedirect": { "hostRedirect": string, "pathRedirect": string, "prefixRedirect": string, "redirectResponseCode": enum, "httpsRedirect": boolean, "stripQuery": boolean }, "headerAction": { "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ], "responseHeadersToRemove": [ string ], "responseHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ] }, "httpFilterConfigs": [ { "filterName": string, "configTypeUrl": string, "config": string } ], "httpFilterMetadata": [ { "filterName": string, "configTypeUrl": string, "config": string } ] } ], "headerAction": { "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ], "responseHeadersToRemove": [ string ], "responseHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ] } } ], "tests": [ { "description": string, "host": string, "path": string, "headers": [ { "name": string, "value": string } ], "service": string, "expectedOutputUrl": string, "expectedRedirectResponseCode": integer } ], "defaultService": string, "defaultRouteAction": { "weightedBackendServices": [ { "backendService": string, "weight": integer, "headerAction": { "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ], "responseHeadersToRemove": [ string ], "responseHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ] } } ], "urlRewrite": { "pathPrefixRewrite": string, "hostRewrite": string }, "timeout": { "seconds": string, "nanos": integer }, "retryPolicy": { "retryConditions": [ string ], "numRetries": integer, "perTryTimeout": { "seconds": string, "nanos": integer } }, "requestMirrorPolicy": { "backendService": string }, "corsPolicy": { "allowOrigins": [ string ], "allowOriginRegexes": [ string ], "allowMethods": [ string ], "allowHeaders": [ string ], "exposeHeaders": [ string ], "maxAge": integer, "allowCredentials": boolean, "disabled": boolean }, "faultInjectionPolicy": { "delay": { "fixedDelay": { "seconds": string, "nanos": integer }, "percentage": number }, "abort": { "httpStatus": integer, "percentage": number } } }, "defaultUrlRedirect": { "hostRedirect": string, "pathRedirect": string, "prefixRedirect": string, "redirectResponseCode": enum, "httpsRedirect": boolean, "stripQuery": boolean }, "headerAction": { "requestHeadersToRemove": [ string ], "requestHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ], "responseHeadersToRemove": [ string ], "responseHeadersToAdd": [ { "headerName": string, "headerValue": string, "replace": boolean } ] }, "fingerprint": string, "region": string, "kind": string } } |
Fields | |
---|---|
resource |
Content of the UrlMap to be validated. |
resource.id |
[Output Only] The unique identifier for the resource. This identifier is defined by the server. |
resource.creationTimestamp |
[Output Only] Creation timestamp in RFC3339 text format. |
resource.name |
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression |
resource.description |
An optional description of this resource. Provide this property when you create the resource. |
resource.selfLink |
[Output Only] Server-defined URL for the resource. |
resource.hostRules[] |
The list of HostRules to use against the URL. |
resource.hostRules[].description |
An optional description of this resource. Provide this property when you create the resource. |
resource.hostRules[].hosts[] |
The list of host patterns to match. They must be valid hostnames with optional port numbers in the format
|
resource.hostRules[].pathMatcher |
The name of the PathMatcher to use to match the path portion of the URL if the |
resource.pathMatchers[] |
The list of named PathMatchers to use against the URL. |
resource.pathMatchers[].name |
The name to which this PathMatcher is referred by the HostRule. |
resource.pathMatchers[].description |
An optional description of this resource. Provide this property when you create the resource. |
resource.pathMatchers[].defaultService |
The full or partial URL to the BackendService resource. This will be used if none of the
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 weightedBackendService s. Conversely, if defaultRouteAction specifies any weightedBackendService s, defaultService must not be specified. Only one of Authorization requires one or more of the following Google IAM permissions on the specified resource defaultService:
|
resource.pathMatchers[].defaultRouteAction |
Only one of UrlMaps for external HTTP(S) load balancers support only the |
resource.pathMatchers[].defaultRouteAction.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 Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].backendService |
The full or partial URL to the default BackendService resource. Before forwarding the request to |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].weight |
Specifies the fraction of traffic sent to backendService, computed as The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a The value must be between 0 and 1000 |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction |
Specifies changes to request and response headers that need to take effect for the selected
Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToRemove[] |
A list of header names for headers that need to be removed from the request prior to forwarding the request to the |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[] |
Headers to add to a matching request prior to forwarding the request to the |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerName |
The name of the header. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerValue |
The value of the header to add. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].replace |
If false, The default value is false. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.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. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[] |
Headers to add the response prior to sending the response back to the client. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerName |
The name of the header. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerValue |
The value of the header to add. |
resource.pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace |
If false, The default value is false. |
resource.pathMatchers[].defaultRouteAction.urlRewrite |
The spec to modify the URL of the request, prior to forwarding the request to the matched service. Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
resource.pathMatchers[].defaultRouteAction.urlRewrite.pathPrefixRewrite |
Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by The value must be between 1 and 1024 characters. |
resource.pathMatchers[].defaultRouteAction.urlRewrite.hostRewrite |
Prior to forwarding the request to the selected service, the request's host header is replaced with contents of The value must be between 1 and 255 characters. |
resource.pathMatchers[].defaultRouteAction.timeout |
Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. If not specified, will use the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
resource.pathMatchers[].defaultRouteAction.timeout.seconds |
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 |
resource.pathMatchers[].defaultRouteAction.timeout.nanos |
Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 |
resource.pathMatchers[].defaultRouteAction.retryPolicy |
Specifies the retry policy associated with this route. Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
resource.pathMatchers[].defaultRouteAction.retryPolicy.retryConditions[] |
Specfies one or more conditions when this retry rule applies. Valid values are:
|
resource.pathMatchers[].defaultRouteAction.retryPolicy.numRetries |
Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. |
resource.pathMatchers[].defaultRouteAction.retryPolicy.perTryTimeout |
Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in HttpRouteAction. If timeout in HttpRouteAction is not set, will use the largest timeout among all backend services associated with the route. |
resource.pathMatchers[].defaultRouteAction.retryPolicy.perTryTimeout.seconds |
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 |
resource.pathMatchers[].defaultRouteAction.retryPolicy.perTryTimeout.nanos |
Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 |
resource.pathMatchers[].defaultRouteAction.requestMirrorPolicy |
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 Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
resource.pathMatchers[].defaultRouteAction.requestMirrorPolicy.backendService |
The full or partial URL to the BackendService resource being mirrored to. |
resource.pathMatchers[].defaultRouteAction.corsPolicy |
The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing Not supported when the URL map is bound to target gRPC proxy. |
resource.pathMatchers[].defaultRouteAction.corsPolicy.allowOrigins[] |
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in |
resource.pathMatchers[].defaultRouteAction.corsPolicy.allowOriginRegexes[] |
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in |
resource.pathMatchers[].defaultRouteAction.corsPolicy.allowMethods[] |
Specifies the content for the |
resource.pathMatchers[].defaultRouteAction.corsPolicy.allowHeaders[] |
Specifies the content for the |
resource.pathMatchers[].defaultRouteAction.corsPolicy.exposeHeaders[] |
Specifies the content for the |
resource.pathMatchers[].defaultRouteAction.corsPolicy.maxAge |
Specifies how long results of a preflight request can be cached in seconds. This translates to the |
resource.pathMatchers[].defaultRouteAction.corsPolicy.allowCredentials |
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Default is false. |
resource.pathMatchers[].defaultRouteAction.corsPolicy.disabled |
If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. |
resource.pathMatchers[].defaultRouteAction.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.
Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay |
The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay |
Specifies the value of the fixed delay interval. |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds |
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 |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos |
Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.percentage |
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. |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.abort |
The specification for how client requests are aborted as part of fault injection. |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.abort.httpStatus |
The HTTP status code used to abort the request. The value must be between 200 and 599 inclusive. |
resource.pathMatchers[].defaultRouteAction.faultInjectionPolicy.abort.percentage |
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. |
resource.pathMatchers[].defaultUrlRedirect |
When none of the specified If Not supported when the URL map is bound to target gRPC proxy. |
resource.pathMatchers[].defaultUrlRedirect.hostRedirect |
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. |
resource.pathMatchers[].defaultUrlRedirect.pathRedirect |
The path 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 1024 characters. |
resource.pathMatchers[].defaultUrlRedirect.prefixRedirect |
The prefix that replaces the
The value must be between 1 and 1024 characters. |
resource.pathMatchers[].defaultUrlRedirect.redirectResponseCode |
The HTTP Status code to use for this RedirectAction. Supported values are:
|
resource.pathMatchers[].defaultUrlRedirect.httpsRedirect |
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 The default is set to false. |
resource.pathMatchers[].defaultUrlRedirect.stripQuery |
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. |
resource.pathMatchers[].pathRules[] |
The list of path rules. Use this list instead of For example: a Within a given |
resource.pathMatchers[].pathRules[].service |
The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If Only one of |
resource.pathMatchers[].pathRules[].routeAction |
In response to a matching Only one of UrlMaps for external HTTP(S) load balancers support only the |
resource.pathMatchers[].pathRules[].routeAction.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 Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].backendService |
The full or partial URL to the default BackendService resource. Before forwarding the request to |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].weight |
Specifies the fraction of traffic sent to backendService, computed as The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a The value must be between 0 and 1000 |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction |
Specifies changes to request and response headers that need to take effect for the selected
Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToRemove[] |
A list of header names for headers that need to be removed from the request prior to forwarding the request to the |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[] |
Headers to add to a matching request prior to forwarding the request to the |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerName |
The name of the header. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerValue |
The value of the header to add. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].replace |
If false, The default value is false. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.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. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[] |
Headers to add the response prior to sending the response back to the client. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerName |
The name of the header. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerValue |
The value of the header to add. |
resource.pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace |
If false, The default value is false. |
resource.pathMatchers[].pathRules[].routeAction.urlRewrite |
The spec to modify the URL of the request, prior to forwarding the request to the matched service. Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. |
re |