Class HTTPRoute
Describes the properties of a specific HTTPRoute of a service.
Namespace: Neon.Kube.Resources.Istio
Assembly: Neon.Kube.Resources.dll
Syntax
public class HTTPRoute
Constructors
HTTPRoute()
Initializes a new instance of the HTTPRoute class.
Declaration
public HTTPRoute()
Properties
CorsPolicy
Cross-Origin Resource Sharing policy (CORS). Refer to CORS for further details about cross origin resource sharing.
Declaration
[JsonProperty(PropertyName = "corsPolicy", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public CorsPolicy CorsPolicy { get; set; }
Property Value
Type | Description |
---|---|
CorsPolicy |
Delegate
Delegate is used to specify the particular V1VirtualService which can be used to define delegate HTTPRoute.
It can be set only when Route and Redirect are empty, and the route rules of the delegate V1VirtualService will be merged with that in the current one.
Declaration
[JsonProperty(PropertyName = "delegate", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public Delegate Delegate { get; set; }
Property Value
Type | Description |
---|---|
Delegate |
Remarks
Only one level delegation is supported. The delegate’s HTTPMatchRequest must be a strict subset of the root’s, otherwise there is a conflict and the HTTPRoute will not take effect.
Fault
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.
Declaration
[JsonProperty(PropertyName = "fault", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public HTTPFaultInjection Fault { get; set; }
Property Value
Type | Description |
---|---|
HTTPFaultInjection |
Headers
Header manipulation rules
Declaration
[JsonProperty(PropertyName = "headers", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public Headers Headers { get; set; }
Property Value
Type | Description |
---|---|
Headers |
Match
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.
Declaration
[JsonProperty(PropertyName = "match", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public List<HTTPMatchRequest> Match { get; set; }
Property Value
Type | Description |
---|---|
List<HTTPMatchRequest> |
Mirror
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.
Declaration
[JsonProperty(PropertyName = "mirror", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public Destination Mirror { get; set; }
Property Value
Type | Description |
---|---|
Destination |
MirrorPercent
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
Declaration
[JsonProperty(PropertyName = "mirrorPercent", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public UInt32Value MirrorPercent { get; set; }
Property Value
Type | Description |
---|---|
UInt32Value |
MirrorPercentage
Percentage of the traffic to be mirrored by the mirror field. If this field is absent, all the traffic (100%) will be mirrored.
Declaration
[JsonProperty(PropertyName = "mirrorPercentage", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public Percent MirrorPercentage { get; set; }
Property Value
Type | Description |
---|---|
Percent |
Remarks
Max value is 100.
Name
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.
Declaration
[JsonProperty(PropertyName = "name", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Redirect
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.
Declaration
[JsonProperty(PropertyName = "redirect", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public HTTPRedirect Redirect { get; set; }
Property Value
Type | Description |
---|---|
HTTPRedirect |
Retries
Retry policy for HTTP requests.
Declaration
[JsonProperty(PropertyName = "retries", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public HTTPRetry Retries { get; set; }
Property Value
Type | Description |
---|---|
HTTPRetry |
Rewrite
Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with Redirect primitive. Rewrite will be performed before forwarding.
Declaration
[JsonProperty(PropertyName = "rewrite", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public HTTPRewrite Rewrite { get; set; }
Property Value
Type | Description |
---|---|
HTTPRewrite |
Route
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.
Declaration
[JsonProperty(PropertyName = "route", Required = Required.Always)]
public List<HTTPRouteDestination> Route { get; set; }
Property Value
Type | Description |
---|---|
List<HTTPRouteDestination> |
Timeout
Timeout for HTTP requests, default is disabled.
Declaration
[JsonProperty(PropertyName = "timeout", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public string Timeout { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Validate()
Validate the object.
Declaration
public virtual void Validate()
Exceptions
Type | Condition |
---|---|
ValidationException | Thrown if validation fails. |