HTTPRoute class

Describes match conditions and actions for routing HTTP/1.1, HTTP2, and gRPC traffic. See VirtualService for usage examples.

Constructors

HTTPRoute({String? name, List<HTTPMatchRequest>? match, List<HTTPRouteDestination>? route, HTTPRedirect? redirect, Delegate? delegate, HTTPRewrite? rewrite, Duration? timeout, HTTPRetry? retries, HTTPFaultInjection? fault, Destination? mirror, Percent? mirrorPercentage, CorsPolicy? corsPolicy, Headers? headers, int? mirrorPercent})
The main constructor.
const
HTTPRoute.fromJson(Map<String, dynamic> json)
Creates a HTTPRoute from JSON data.

Properties

corsPolicy CorsPolicy?
Cross-Origin Resource Sharing policy (CORS). Refer to CORS for further details about cross origin resource sharing.
final
delegate Delegate?
Delegate is used to specify the particular VirtualService which can be used to define delegate HTTPRoute.
final
fault HTTPFaultInjection?
Fault injection policy to apply on HTTP traffic at the client side. Note that timeouts or retries will not be enabled when faults are enabled on the client side.
final
hashCode int
The hash code for this object.
no setterinherited
headers Headers?
Header manipulation rules.
final
match List<HTTPMatchRequest>?
Match conditions to be satisfied for the rule to be activated. All conditions inside a single match block have AND semantics, while the list of match blocks have OR semantics. The rule is matched if any one of the match blocks succeed.
final
mirror Destination?
Mirror HTTP traffic to a another destination in addition to forwarding the requests to the intended destination. Mirrored traffic is on a best effort basis where the sidecar/gateway will not wait for the mirrored cluster to respond before returning the response from the original destination. Statistics will be generated for the mirrored destination.
final
mirrorPercent int?
Percentage of the traffic to be mirrored by the mirror field. Use of integer mirror_percent value is deprecated. Use the double mirror_percentage field instead.
final
mirrorPercentage Percent?
Percentage of the traffic to be mirrored by the mirror field. If this field is absent, all the traffic (100%) will be mirrored. Max value is 100.
final
name String?
The name assigned to the route for debugging purposes. The route’s name will be concatenated with the match’s name and will be logged in the access logs for requests matching this route/match.
final
redirect HTTPRedirect?
A HTTP rule can either redirect or forward (default) traffic. If traffic passthrough option is specified in the rule, route/redirect will be ignored. The redirect primitive can be used to send a HTTP 301 redirect to a different URI or Authority.
final
retries HTTPRetry?
Retry policy for HTTP requests.
final
rewrite HTTPRewrite?
Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with Redirect primitive. Rewrite will be performed before forwarding.
final
route List<HTTPRouteDestination>?
A HTTP rule can either redirect or forward (default) traffic. The forwarding target can be one of several versions of a service (see glossary in beginning of document). Weights associated with the service version determine the proportion of traffic it receives.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration?
Timeout for HTTP requests, default is disabled.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited