Note: This message needs to be at this level (rather than nested) due to cue restrictions. DelegateActions are used to delegate routing decisions to other resources, for example RouteTables.
Delegate to the RouteTables that match the given selector. Selected route tables are ordered by creation time stamp in ascending order to guarantee consistent ordering.
Specifies the HTTP response status to be returned.
body
string
Specifies the content of the response body. If this setting is omitted, no body is included in the generated response. Note: Headers can be specified using the Header Modification feature in the enclosing Route, ConnectionHandler, or Gateway options.
The host portion of the URL will be swapped with this value.
pathRedirect
string
The path portion of the URL will be swapped with this value.
prefixRewrite
string
Indicates that during redirection, the matched prefix (or path) should be swapped with this value. This option allows redirect URLs be dynamically created based on the request. Pay attention to the use of trailing slashes as mentioned in RouteAction's prefix_rewrite.
The HTTP status code to use in the redirect response. The default response code is MOVED_PERMANENTLY (301).
httpsRedirect
bool
The scheme portion of the URL will be swapped with “https”.
stripQuery
bool
Indicates that during redirection, the query portion of the URL will be removed. Default value is false.
Route
A route specifies how to match a request and what action to take when the request is matched. When a request matches on a route, the route can perform one of the following actions: - Route the request to a destination - Reply with a Direct Response - Send a Redirect response to the client - Delegate the action for the request to one or more RouteTable resources DelegateActions can be used to delegate the behavior for a set out routes to RouteTable resources.
Field
Type
Label
Description
name
string
The name provides a convenience for users to be able to refer to a route by name. It includes names of VS, Route, and RouteTable ancestors of the Route.
Matchers contain parameters for matching requests (i.e., based on HTTP path, headers, etc.). If empty, the route will match all requests (i.e, a single “/” path prefix matcher). For delegated routes, any parent matcher must have a prefix path matcher.
Route Options extend the behavior of routes. Route options include configuration such as retries, rate limiting, and request/response transformation. RouteOption behavior will be inherited by delegated routes which do not specify their own options
Defines the destination upstream for routing Some destinations require additional configuration for the route (e.g. AWS upstreams require a function name to be specified).
pathRewrite
string
Replace the path specified in the matcher with this value before passing upstream. When a prefix matcher is used, only the prefix portion of the path is rewritten. When an exact matcher is used, the whole path is replaced. Rewriting the path when a regex matcher is used is currently unsupported.
DelegateAction.SortMethod
Name
Number
Description
TABLE_WEIGHT
0
Routes are kept in the order that they appear relative to their tables, but tables are sorted by weight. Tables that have the same weight will stay in the same order that they are listed in, which is the list order when given as a reference and by creation timestamp when selected.
ROUTE_SPECIFICITY
1
After processing all routes, including additional route tables delegated to, the resulting routes are sorted by specificity to reduce the chance that a more specific route will be short-circuited by a general route. Matchers with exact path matchers are considered more specific than regex path patchers, which are more specific than prefix path matchers. Matchers of the same type are sorted by length of the path in descending order. Only the most specific matcher on each route is used.