Method: urlMaps.list

Retrieves the list of UrlMap resources available to the specified project.

HTTP request

GET https://compute.googleapis.com/compute/v1/projects/{project}/global/urlMaps

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

Query parameters

Parameters
maxResults

number (uint32 format)

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).

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.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "id": string,
  "items": [
    {
      "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": number,
                "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": number
            },
            "retryPolicy": {
              "retryConditions": [
                string
              ],
              "numRetries": number,
              "perTryTimeout": {
                "seconds": string,
                "nanos": number
              }
            },
            "requestMirrorPolicy": {
              "backendService": string
            },
            "corsPolicy": {
              "allowOrigins": [
                string
              ],
              "allowOriginRegexes": [
                string
              ],
              "allowMethods": [
                string
              ],
              "allowHeaders": [
                string
              ],
              "exposeHeaders": [
                string
              ],
              "maxAge": number,
              "allowCredentials": boolean,
              "disabled": boolean
            },
            "faultInjectionPolicy": {
              "delay": {
                "fixedDelay": {
                  "seconds": string,
                  "nanos": number
                },
                "percentage": number
              },
              "abort": {
                "httpStatus": number,
                "percentage": number
              }
            }
          },
          "defaultUrlRedirect": {
            "hostRedirect": string,
            "pathRedirect": string,
            "prefixRedirect": string,
            "redirectResponseCode": enum,
            "httpsRedirect": boolean,
            "stripQuery": boolean
          },
          "pathRules": [
            {
              "service": string,
              "routeAction": {
                "weightedBackendServices": [
                  {
                    "backendService": string,
                    "weight": number,
                    "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": number
                },
                "retryPolicy": {
                  "retryConditions": [
                    string
                  ],
                  "numRetries": number,
                  "perTryTimeout": {
                    "seconds": string,
                    "nanos": number
                  }
                },
                "requestMirrorPolicy": {
                  "backendService": string
                },
                "corsPolicy": {
                  "allowOrigins": [
                    string
                  ],
                  "allowOriginRegexes": [
                    string
                  ],
                  "allowMethods": [
                    string
                  ],
                  "allowHeaders": [
                    string
                  ],
                  "exposeHeaders": [
                    string
                  ],
                  "maxAge": number,
                  "allowCredentials": boolean,
                  "disabled": boolean
                },
                "faultInjectionPolicy": {
                  "delay": {
                    "fixedDelay": {
                      "seconds": string,
                      "nanos": number
                    },
                    "percentage": number
                  },
                  "abort": {
                    "httpStatus": number,
                    "percentage": number
                  }
                }
              },
              "urlRedirect": {
                "hostRedirect": string,
                "pathRedirect": string,
                "prefixRedirect": string,
                "redirectResponseCode": enum,
                "httpsRedirect": boolean,
                "stripQuery": boolean
              },
              "paths": [
                string
              ]
            }
          ],
          "routeRules": [
            {
              "priority": number,
              "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": number,
                    "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": number
                },
                "retryPolicy": {
                  "retryConditions": [
                    string
                  ],
                  "numRetries": number,
                  "perTryTimeout": {
                    "seconds": string,
                    "nanos": number
                  }
                },
                "requestMirrorPolicy": {
                  "backendService": string
                },
                "corsPolicy": {
                  "allowOrigins": [
                    string
                  ],
                  "allowOriginRegexes": [
                    string
                  ],
                  "allowMethods": [
                    string
                  ],
                  "allowHeaders": [
                    string
                  ],
                  "exposeHeaders": [
                    string
                  ],
                  "maxAge": number,
                  "allowCredentials": boolean,
                  "disabled": boolean
                },
                "faultInjectionPolicy": {
                  "delay": {
                    "fixedDelay": {
                      "seconds": string,
                      "nanos": number
                    },
                    "percentage": number
                  },
                  "abort": {
                    "httpStatus": number,
                    "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
                  }
                ]
              }
            }
          ],
          "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,
          "service": string
        }
      ],
      "defaultService": string,
      "defaultRouteAction": {
        "weightedBackendServices": [
          {
            "backendService": string,
            "weight": number,
            "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": number
        },
        "retryPolicy": {
          "retryConditions": [
            string
          ],
          "numRetries": number,
          "perTryTimeout": {
            "seconds": string,
            "nanos": number
          }
        },
        "requestMirrorPolicy": {
          "backendService": string
        },
        "corsPolicy": {
          "allowOrigins": [
            string
          ],
          "allowOriginRegexes": [
            string
          ],
          "allowMethods": [
            string
          ],
          "allowHeaders": [
            string
          ],
          "exposeHeaders": [
            string
          ],
          "maxAge": number,
          "allowCredentials": boolean,
          "disabled": boolean
        },
        "faultInjectionPolicy": {
          "delay": {
            "fixedDelay": {
              "seconds": string,
              "nanos": number
            },
            "percentage": number
          },
          "abort": {
            "httpStatus": number,
            "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
    }
  ],
  "nextPageToken": string,
  "selfLink": string,
  "warning": {
    "code": enum,
    "message": string,
    "data": [
      {
        "key": string,
        "value": string
      }
    ]
  },
  "kind": string
}
Fields
id

string

[Output Only] Unique identifier for the resource; defined by the server.

items[]

object

A list of UrlMap resources.

items[].id

string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

items[].creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

items[].name

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.

items[].description

string

An optional description of this resource. Provide this property when you create the resource.

items[].selfLink

string

[Output Only] Server-defined URL for the resource.

items[].hostRules[]

object

The list of HostRules to use against the URL.

items[].hostRules[].description

string

An optional description of this resource. Provide this property when you create the resource.

items[].hostRules[].hosts[]

string

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 ..

items[].hostRules[].pathMatcher

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.

items[].pathMatchers[]

object

The list of named PathMatchers to use against the URL.

items[].pathMatchers[].name

string

The name to which this PathMatcher is referred by the HostRule.

items[].pathMatchers[].description

string

An optional description of this resource. Provide this property when you create the resource.

items[].pathMatchers[].defaultService

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:

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 defaultService:

  • compute.backendBuckets.use
  • compute.backendServices.use

items[].pathMatchers[].defaultRouteAction

object

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.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[]

object

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.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].backendService

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.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].weight

number (uint32 format)

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

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction

object

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.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToRemove[]

string

A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[]

object

Headers to add to a matching request prior to forwarding the request to the backendService.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToRemove[]

string

A list of header names for headers that need to be removed from the response prior to sending the response back to the client.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[]

object

Headers to add the response prior to sending the response back to the client.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].defaultRouteAction.urlRewrite

object

The spec to modify the URL of the request, prior to forwarding the request to the matched service

items[].pathMatchers[].defaultRouteAction.urlRewrite.pathPrefixRewrite

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.

items[].pathMatchers[].defaultRouteAction.urlRewrite.hostRewrite

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.

items[].pathMatchers[].defaultRouteAction.timeout

object

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.

items[].pathMatchers[].defaultRouteAction.timeout.seconds

string (int64 format)

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

items[].pathMatchers[].defaultRouteAction.timeout.nanos

number

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.

items[].pathMatchers[].defaultRouteAction.retryPolicy

object

Specifies the retry policy associated with this route.

items[].pathMatchers[].defaultRouteAction.retryPolicy.retryConditions[]

string

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

items[].pathMatchers[].defaultRouteAction.retryPolicy.numRetries

number (uint32 format)

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

items[].pathMatchers[].defaultRouteAction.retryPolicy.perTryTimeout

object

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.

items[].pathMatchers[].defaultRouteAction.retryPolicy.perTryTimeout.seconds

string (int64 format)

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

items[].pathMatchers[].defaultRouteAction.retryPolicy.perTryTimeout.nanos

number

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.

items[].pathMatchers[].defaultRouteAction.requestMirrorPolicy

object

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.

items[].pathMatchers[].defaultRouteAction.requestMirrorPolicy.backendService

string

The full or partial URL to the BackendService resource being mirrored to.

items[].pathMatchers[].defaultRouteAction.corsPolicy

object

The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing

items[].pathMatchers[].defaultRouteAction.corsPolicy.allowOrigins[]

string

Specifies the list of origins that will be allowed to do CORS requests.

An origin is allowed if it matches either allow_origins or allowOriginRegex.

items[].pathMatchers[].defaultRouteAction.corsPolicy.allowOriginRegexes[]

string

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 allowOriginRegex.

items[].pathMatchers[].defaultRouteAction.corsPolicy.allowMethods[]

string

Specifies the content for the Access-Control-Allow-Methods header.

items[].pathMatchers[].defaultRouteAction.corsPolicy.allowHeaders[]

string

Specifies the content for the Access-Control-Allow-Headers header.

items[].pathMatchers[].defaultRouteAction.corsPolicy.exposeHeaders[]

string

Specifies the content for the Access-Control-Expose-Headers header.

items[].pathMatchers[].defaultRouteAction.corsPolicy.maxAge

number

Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header.

items[].pathMatchers[].defaultRouteAction.corsPolicy.allowCredentials

boolean

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.

items[].pathMatchers[].defaultRouteAction.corsPolicy.disabled

boolean

If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy

object

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 retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay

object

The specification for how client requests are delayed as part of fault injection, before being sent to a backend service.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay

object

Specifies the value of the fixed delay interval.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds

string (int64 format)

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

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos

number

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.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.delay.percentage

number

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.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.abort

object

The specification for how client requests are aborted as part of fault injection.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.abort.httpStatus

number (uint32 format)

The HTTP status code used to abort the request.

The value must be between 200 and 599 inclusive.

items[].pathMatchers[].defaultRouteAction.faultInjectionPolicy.abort.percentage

number

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.

items[].pathMatchers[].defaultUrlRedirect

object

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.

items[].pathMatchers[].defaultUrlRedirect.hostRedirect

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.

items[].pathMatchers[].defaultUrlRedirect.pathRedirect

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.

items[].pathMatchers[].defaultUrlRedirect.prefixRedirect

string

The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request.

items[].pathMatchers[].defaultUrlRedirect.redirectResponseCode

enum

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.

items[].pathMatchers[].defaultUrlRedirect.httpsRedirect

boolean

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.

items[].pathMatchers[].defaultUrlRedirect.stripQuery

boolean

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.

items[].pathMatchers[].pathRules[]

object

The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis.

For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list.

Within a given pathMatcher, only one of pathRules or routeRules must be set.

items[].pathMatchers[].pathRules[].service

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.

items[].pathMatchers[].pathRules[].routeAction

object

In response to a matching path, 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.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[]

object

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.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].backendService

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.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].weight

number (uint32 format)

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

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction

object

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.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToRemove[]

string

A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[]

object

Headers to add to a matching request prior to forwarding the request to the backendService.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToRemove[]

string

A list of header names for headers that need to be removed from the response prior to sending the response back to the client.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[]

object

Headers to add the response prior to sending the response back to the client.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].pathRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].pathRules[].routeAction.urlRewrite

object

The spec to modify the URL of the request, prior to forwarding the request to the matched service

items[].pathMatchers[].pathRules[].routeAction.urlRewrite.pathPrefixRewrite

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.

items[].pathMatchers[].pathRules[].routeAction.urlRewrite.hostRewrite

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.

items[].pathMatchers[].pathRules[].routeAction.timeout

object

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.

items[].pathMatchers[].pathRules[].routeAction.timeout.seconds

string (int64 format)

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

items[].pathMatchers[].pathRules[].routeAction.timeout.nanos

number

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.

items[].pathMatchers[].pathRules[].routeAction.retryPolicy

object

Specifies the retry policy associated with this route.

items[].pathMatchers[].pathRules[].routeAction.retryPolicy.retryConditions[]

string

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

items[].pathMatchers[].pathRules[].routeAction.retryPolicy.numRetries

number (uint32 format)

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

items[].pathMatchers[].pathRules[].routeAction.retryPolicy.perTryTimeout

object

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.

items[].pathMatchers[].pathRules[].routeAction.retryPolicy.perTryTimeout.seconds

string (int64 format)

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

items[].pathMatchers[].pathRules[].routeAction.retryPolicy.perTryTimeout.nanos

number

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.

items[].pathMatchers[].pathRules[].routeAction.requestMirrorPolicy

object

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.

items[].pathMatchers[].pathRules[].routeAction.requestMirrorPolicy.backendService

string

The full or partial URL to the BackendService resource being mirrored to.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy

object

The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.allowOrigins[]

string

Specifies the list of origins that will be allowed to do CORS requests.

An origin is allowed if it matches either allow_origins or allowOriginRegex.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.allowOriginRegexes[]

string

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 allowOriginRegex.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.allowMethods[]

string

Specifies the content for the Access-Control-Allow-Methods header.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.allowHeaders[]

string

Specifies the content for the Access-Control-Allow-Headers header.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.exposeHeaders[]

string

Specifies the content for the Access-Control-Expose-Headers header.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.maxAge

number

Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.allowCredentials

boolean

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.

items[].pathMatchers[].pathRules[].routeAction.corsPolicy.disabled

boolean

If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy

object

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 retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.delay

object

The specification for how client requests are delayed as part of fault injection, before being sent to a backend service.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.delay.fixedDelay

object

Specifies the value of the fixed delay interval.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.delay.fixedDelay.seconds

string (int64 format)

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

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.delay.fixedDelay.nanos

number

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.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.delay.percentage

number

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.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.abort

object

The specification for how client requests are aborted as part of fault injection.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.abort.httpStatus

number (uint32 format)

The HTTP status code used to abort the request.

The value must be between 200 and 599 inclusive.

items[].pathMatchers[].pathRules[].routeAction.faultInjectionPolicy.abort.percentage

number

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.

items[].pathMatchers[].pathRules[].urlRedirect

object

When a path pattern is matched, the request is redirected to a URL specified by urlRedirect.

If urlRedirect is specified, service or routeAction must not be set.

items[].pathMatchers[].pathRules[].urlRedirect.hostRedirect

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.

items[].pathMatchers[].pathRules[].urlRedirect.pathRedirect

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.

items[].pathMatchers[].pathRules[].urlRedirect.prefixRedirect

string

The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request.

items[].pathMatchers[].pathRules[].urlRedirect.redirectResponseCode

enum

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.

items[].pathMatchers[].pathRules[].urlRedirect.httpsRedirect

boolean

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.

items[].pathMatchers[].pathRules[].urlRedirect.stripQuery

boolean

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.

items[].pathMatchers[].pathRules[].paths[]

string

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

items[].pathMatchers[].routeRules[]

object

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.

Within a given pathMatcher, only one of pathRules or routeRules must be set.

routeRules are not supported in UrlMaps intended for External Load balancers.

items[].pathMatchers[].routeRules[].priority

number

For routeRules within a given pathMatcher, priority determines the order in which load balancer will interpret routeRules. RouteRules are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied.

You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 0 and 2147483647 inclusive.

Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules.

items[].pathMatchers[].routeRules[].description

string

The short description conveying the intent of this routeRule.

The description can have a maximum length of 1024 characters.

items[].pathMatchers[].routeRules[].matchRules[]

object

items[].pathMatchers[].routeRules[].matchRules[].prefixMatch

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.

items[].pathMatchers[].routeRules[].matchRules[].fullPathMatch

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.

items[].pathMatchers[].routeRules[].matchRules[].regexMatch

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.

items[].pathMatchers[].routeRules[].matchRules[].ignoreCase

boolean

Specifies that prefixMatch and fullPathMatch matches are case sensitive.

The default value is false.

caseSensitive must not be used with regexMatch.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[]

object

Specifies a list of header match criteria, all of which must match corresponding headers in the request.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].headerName

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".

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].exactMatch

string

The value should exactly match contents of exactMatch.

Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].regexMatch

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.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].rangeMatch

object

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.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].rangeMatch.rangeStart

string (int64 format)

The start of the range (inclusive) in signed long integer format.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].rangeMatch.rangeEnd

string (int64 format)

The end of the range (exclusive) in signed long integer format.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].presentMatch

boolean

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.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].prefixMatch

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.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].suffixMatch

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.

items[].pathMatchers[].routeRules[].matchRules[].headerMatches[].invertMatch

boolean

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.

items[].pathMatchers[].routeRules[].matchRules[].queryParameterMatches[]

object

Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request.

items[].pathMatchers[].routeRules[].matchRules[].queryParameterMatches[].name

string

The name of the query parameter to match. The query parameter must exist in the request, in the absence of which the request match fails.

items[].pathMatchers[].routeRules[].matchRules[].queryParameterMatches[].presentMatch

boolean

Specifies that the queryParameterMatch matches if the request contains the query parameter, irrespective of whether the parameter has a value or not.

Only one of presentMatch, exactMatch and regexMatch must be set.

items[].pathMatchers[].routeRules[].matchRules[].queryParameterMatches[].exactMatch

string

The queryParameterMatch matches if the value of the parameter exactly matches the contents of exactMatch.

Only one of presentMatch, exactMatch and regexMatch must be set.

items[].pathMatchers[].routeRules[].matchRules[].queryParameterMatches[].regexMatch

string

The queryParameterMatch matches if the value of the parameter matches the regular expression specified by regexMatch. For the regular expression grammar, please see en.cppreference.com/w/cpp/regex/ecmascript

Only one of presentMatch, exactMatch and regexMatch must be set.

items[].pathMatchers[].routeRules[].matchRules[].metadataFilters[]

object

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.

items[].pathMatchers[].routeRules[].matchRules[].metadataFilters[].filterMatchCriteria

enum

Specifies how individual filterLabel matches within the list of filterLabels contribute towards the overall metadataFilter match.

Supported values are:

  • MATCH_ANY: At least one of the filterLabels must have a matching label in the provided metadata.
  • MATCH_ALL: All filterLabels must have matching labels in the provided metadata.

items[].pathMatchers[].routeRules[].matchRules[].metadataFilters[].filterLabels[]

object

The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria

This list must not be empty and can have at the most 64 entries.

items[].pathMatchers[].routeRules[].matchRules[].metadataFilters[].filterLabels[].name

string

Name of metadata label.

The name can have a maximum length of 1024 characters and must be at least 1 character long.

items[].pathMatchers[].routeRules[].matchRules[].metadataFilters[].filterLabels[].value

string

The value of the label must match the specified value.

value can have a maximum length of 1024 characters.

items[].pathMatchers[].routeRules[].service

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.

items[].pathMatchers[].routeRules[].routeAction

object

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.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[]

object

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.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].backendService

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.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].weight

number (uint32 format)

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

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction

object

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.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToRemove[]

string

A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[]

object

Headers to add to a matching request prior to forwarding the request to the backendService.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToRemove[]

string

A list of header names for headers that need to be removed from the response prior to sending the response back to the client.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[]

object

Headers to add the response prior to sending the response back to the client.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].routeRules[].routeAction.urlRewrite

object

The spec to modify the URL of the request, prior to forwarding the request to the matched service

items[].pathMatchers[].routeRules[].routeAction.urlRewrite.pathPrefixRewrite

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.

items[].pathMatchers[].routeRules[].routeAction.urlRewrite.hostRewrite

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.

items[].pathMatchers[].routeRules[].routeAction.timeout

object

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.

items[].pathMatchers[].routeRules[].routeAction.timeout.seconds

string (int64 format)

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

items[].pathMatchers[].routeRules[].routeAction.timeout.nanos

number

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.

items[].pathMatchers[].routeRules[].routeAction.retryPolicy

object

Specifies the retry policy associated with this route.

items[].pathMatchers[].routeRules[].routeAction.retryPolicy.retryConditions[]

string

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

items[].pathMatchers[].routeRules[].routeAction.retryPolicy.numRetries

number (uint32 format)

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

items[].pathMatchers[].routeRules[].routeAction.retryPolicy.perTryTimeout

object

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.

items[].pathMatchers[].routeRules[].routeAction.retryPolicy.perTryTimeout.seconds

string (int64 format)

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

items[].pathMatchers[].routeRules[].routeAction.retryPolicy.perTryTimeout.nanos

number

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.

items[].pathMatchers[].routeRules[].routeAction.requestMirrorPolicy

object

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.

items[].pathMatchers[].routeRules[].routeAction.requestMirrorPolicy.backendService

string

The full or partial URL to the BackendService resource being mirrored to.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy

object

The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.allowOrigins[]

string

Specifies the list of origins that will be allowed to do CORS requests.

An origin is allowed if it matches either allow_origins or allowOriginRegex.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.allowOriginRegexes[]

string

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 allowOriginRegex.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.allowMethods[]

string

Specifies the content for the Access-Control-Allow-Methods header.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.allowHeaders[]

string

Specifies the content for the Access-Control-Allow-Headers header.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.exposeHeaders[]

string

Specifies the content for the Access-Control-Expose-Headers header.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.maxAge

number

Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.allowCredentials

boolean

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.

items[].pathMatchers[].routeRules[].routeAction.corsPolicy.disabled

boolean

If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy

object

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 retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.delay

object

The specification for how client requests are delayed as part of fault injection, before being sent to a backend service.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.delay.fixedDelay

object

Specifies the value of the fixed delay interval.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.delay.fixedDelay.seconds

string (int64 format)

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

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.delay.fixedDelay.nanos

number

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.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.delay.percentage

number

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.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.abort

object

The specification for how client requests are aborted as part of fault injection.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.abort.httpStatus

number (uint32 format)

The HTTP status code used to abort the request.

The value must be between 200 and 599 inclusive.

items[].pathMatchers[].routeRules[].routeAction.faultInjectionPolicy.abort.percentage

number

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.

items[].pathMatchers[].routeRules[].urlRedirect

object

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.

items[].pathMatchers[].routeRules[].urlRedirect.hostRedirect

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.

items[].pathMatchers[].routeRules[].urlRedirect.pathRedirect

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.

items[].pathMatchers[].routeRules[].urlRedirect.prefixRedirect

string

The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request.

items[].pathMatchers[].routeRules[].urlRedirect.redirectResponseCode

enum

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.

items[].pathMatchers[].routeRules[].urlRedirect.httpsRedirect

boolean

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.

items[].pathMatchers[].routeRules[].urlRedirect.stripQuery

boolean

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.

items[].pathMatchers[].routeRules[].headerAction

object

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

items[].pathMatchers[].routeRules[].headerAction.requestHeadersToRemove[]

string

A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService.

items[].pathMatchers[].routeRules[].headerAction.requestHeadersToAdd[]

object

Headers to add to a matching request prior to forwarding the request to the backendService.

items[].pathMatchers[].routeRules[].headerAction.requestHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].routeRules[].headerAction.requestHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].routeRules[].headerAction.requestHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].routeRules[].headerAction.responseHeadersToRemove[]

string

A list of header names for headers that need to be removed from the response prior to sending the response back to the client.

items[].pathMatchers[].routeRules[].headerAction.responseHeadersToAdd[]

object

Headers to add the response prior to sending the response back to the client.

items[].pathMatchers[].routeRules[].headerAction.responseHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].routeRules[].headerAction.responseHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].routeRules[].headerAction.responseHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].headerAction

object

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

items[].pathMatchers[].headerAction.requestHeadersToRemove[]

string

A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService.

items[].pathMatchers[].headerAction.requestHeadersToAdd[]

object

Headers to add to a matching request prior to forwarding the request to the backendService.

items[].pathMatchers[].headerAction.requestHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].headerAction.requestHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].headerAction.requestHeadersToAdd[].replace

boolean

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.

items[].pathMatchers[].headerAction.responseHeadersToRemove[]

string

A list of header names for headers that need to be removed from the response prior to sending the response back to the client.

items[].pathMatchers[].headerAction.responseHeadersToAdd[]

object

Headers to add the response prior to sending the response back to the client.

items[].pathMatchers[].headerAction.responseHeadersToAdd[].headerName

string

The name of the header.

items[].pathMatchers[].headerAction.responseHeadersToAdd[].headerValue

string

The value of the header to add.

items[].pathMatchers[].headerAction.responseHeadersToAdd[].replace

boolean

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.

items[].tests[]

object

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.

items[].tests[].description

string

Description of this test case.

items[].tests[].host

string

Host portion of the URL.

items[].tests[].path

string

Path portion of the URL.

items[].tests[].service

string

Expected BackendService resource the given URL should be mapped to.

items[].defaultService

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.

items[].defaultRouteAction

object

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.

items[].defaultRouteAction.weightedBackendServices[]

object

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.

items[].defaultRouteAction.weightedBackendServices[].backendService

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.

items[].defaultRouteAction.weightedBackendServices[].weight

number (uint32 format)

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

items[].defaultRouteAction.weightedBackendServices[].headerAction

object

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.

items[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToRemove[]

string

A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService.

items[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[]

object

Headers to add to a matching request prior to forwarding the request to the backendService.

items[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerName

string

The name of the header.

items[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].headerValue

string

The value of the header to add.

items[].defaultRouteAction.weightedBackendServices[].headerAction.requestHeadersToAdd[].replace

boolean

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.

items[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToRemove[]

string

A list of header names for headers that need to be removed from the response prior to sending the response back to the client.

items[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[]

object

Headers to add the response prior to sending the response back to the client.

items[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerName

string

The name of the header.

items[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerValue

string

The value of the header to add.

items[].defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace

boolean

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.

items[].defaultRouteAction.urlRewrite

object

The spec to modify the URL of the request, prior to forwarding the request to the matched service

items[].defaultRouteAction.urlRewrite.pathPrefixRewrite

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.

items[].defaultRouteAction.urlRewrite.hostRewrite

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.

items[].defaultRouteAction.timeout

object

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.

items[].defaultRouteAction.timeout.seconds

string (int64 format)

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

items[].defaultRouteAction.timeout.nanos

number

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.

items[].defaultRouteAction.retryPolicy

object

Specifies the retry policy associated with this route.

items[].defaultRouteAction.retryPolicy.retryConditions[]

string

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

items[].defaultRouteAction.retryPolicy.numRetries

number (uint32 format)

Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1.

items[].defaultRouteAction.retryPolicy.perTryTimeout

object

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.

items[].defaultRouteAction.retryPolicy.perTryTimeout.seconds

string (int64 format)

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

items[].defaultRouteAction.retryPolicy.perTryTimeout.nanos

number

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.

items[].defaultRouteAction.requestMirrorPolicy

object

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.

items[].defaultRouteAction.requestMirrorPolicy.backendService

string

The full or partial URL to the BackendService resource being mirrored to.

items[].defaultRouteAction.corsPolicy

object

The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing

items[].defaultRouteAction.corsPolicy.allowOrigins[]

string

Specifies the list of origins that will be allowed to do CORS requests.

An origin is allowed if it matches either allow_origins or allowOriginRegex.

items[].defaultRouteAction.corsPolicy.allowOriginRegexes[]

string

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 allowOriginRegex.

items[].defaultRouteAction.corsPolicy.allowMethods[]

string

Specifies the content for the Access-Control-Allow-Methods header.

items[].defaultRouteAction.corsPolicy.allowHeaders[]

string

Specifies the content for the Access-Control-Allow-Headers header.

items[].defaultRouteAction.corsPolicy.exposeHeaders[]

string

Specifies the content for the Access-Control-Expose-Headers header.

items[].defaultRouteAction.corsPolicy.maxAge

number

Specifies how long the results of a preflight request can be cached. This translates to the content for the Access-Control-Max-Age header.

items[].defaultRouteAction.corsPolicy.allowCredentials

boolean

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.

items[].defaultRouteAction.corsPolicy.disabled

boolean

If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.

items[].defaultRouteAction.faultInjectionPolicy

object

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 retryPolicy will be ignored by clients that are configured with a faultInjectionPolicy.

items[].defaultRouteAction.faultInjectionPolicy.delay

object

The specification for how client requests are delayed as part of fault injection, before being sent to a backend service.

items[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay

object

Specifies the value of the fixed delay interval.

items[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds

string (int64 format)

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

items[].defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos

number

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.

items[].defaultRouteAction.faultInjectionPolicy.delay.percentage

number

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.

items[].defaultRouteAction.faultInjectionPolicy.abort

object

The specification for how client requests are aborted as part of fault injection.

items[].defaultRouteAction.faultInjectionPolicy.abort.httpStatus

number (uint32 format)

The HTTP status code used to abort the request.

The value must be between 200 and 599 inclusive.

items[].defaultRouteAction.faultInjectionPolicy.abort.percentage

number

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.

items[].defaultUrlRedirect

object

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.

items[].defaultUrlRedirect.hostRedirect

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.

items[].defaultUrlRedirect.pathRedirect

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.

items[].defaultUrlRedirect.prefixRedirect

string

The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request.

items[].defaultUrlRedirect.redirectResponseCode

enum

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.

items[].defaultUrlRedirect.httpsRedirect

boolean

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.

items[].defaultUrlRedirect.stripQuery

boolean

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.

items[].headerAction

object

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.

items[].headerAction.requestHeadersToRemove[]

string

A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService.

items[].headerAction.requestHeadersToAdd[]

object

Headers to add to a matching request prior to forwarding the request to the backendService.

items[].headerAction.requestHeadersToAdd[].headerName

string

The name of the header.

items[].headerAction.requestHeadersToAdd[].headerValue

string

The value of the header to add.

items[].headerAction.requestHeadersToAdd[].replace

boolean

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.

items[].headerAction.responseHeadersToRemove[]

string

A list of header names for headers that need to be removed from the response prior to sending the response back to the client.

items[].headerAction.responseHeadersToAdd[]

object

Headers to add the response prior to sending the response back to the client.

items[].headerAction.responseHeadersToAdd[].headerName

string

The name of the header.

items[].headerAction.responseHeadersToAdd[].headerValue

string

The value of the header to add.

items[].headerAction.responseHeadersToAdd[].replace

boolean

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.

items[].fingerprint

string (bytes format)

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.

A base64-encoded string.

items[].region

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.

items[].kind

string

[Output Only] Type of the resource. Always compute#urlMaps for url maps.

nextPageToken

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.

warning

object

[Output Only] Informational warning message.

warning.code

enum

[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.

warning.message

string

[Output Only] A human-readable description of the warning code.

warning.data[]

object

[Output Only] Metadata about this warning in key: value format. For example:

"data": [  {  "key": "scope",  "value": "zones/us-east1-d"  }

warning.data[].key

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.data[].value

string

[Output Only] A warning data value corresponding to the key.

kind

string

Type of resource.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:

  • compute.urlMaps.list
¿Te sirvió esta página? Envíanos tu opinión: