#[non_exhaustive]pub struct HttpRouteAction {
pub cors_policy: Option<CorsPolicy>,
pub fault_injection_policy: Option<HttpFaultInjection>,
pub max_stream_duration: Option<Duration>,
pub request_mirror_policy: Option<RequestMirrorPolicy>,
pub retry_policy: Option<HttpRetryPolicy>,
pub timeout: Option<Duration>,
pub url_rewrite: Option<UrlRewrite>,
pub weighted_backend_services: Vec<WeightedBackendService>,
/* private fields */
}region-url-maps or url-maps only.Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cors_policy: Option<CorsPolicy>The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.
Not supported when the URL map is bound to a target gRPC proxy.
fault_injection_policy: Option<HttpFaultInjection>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 a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests.timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if:
- The traffic is generated by fault injection AND
- The fault injection is not a delay fault injection. Fault injection is not supported with the classic Application Load Balancer . To see which load balancers support fault injection, see Load balancing: Routing and traffic management features.
max_stream_duration: Option<Duration>Specifies the maximum duration (timeout) for streams on the selected route. Unlike the timeout field where the timeout duration starts from the time the request has been fully processed (known asend-of-stream), the duration in this field is computed from the beginning of the stream until the response has been processed, including all retries. A stream that does not complete in this duration is closed.
If not specified, this field uses the maximummaxStreamDuration value among all backend services associated with the route.
This field is only allowed if the Url map is used with backend services with loadBalancingScheme set toINTERNAL_SELF_MANAGED.
request_mirror_policy: Option<RequestMirrorPolicy>Specifies the policy on how requests intended for the route’s backends are shadowed to a separate mirrored backend service. The load balancer does not wait for responses from the shadow service. Before sending traffic to the shadow service, the host / authority header is suffixed with-shadow.
Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
retry_policy: Option<HttpRetryPolicy>Specifies the retry policy associated with this route.
timeout: Option<Duration>Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (known as end-of-stream) up until the response has been processed. Timeout includes all retries.
If not specified, this field uses the largest timeout among all backend services associated with the route.
Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true.
url_rewrite: Option<UrlRewrite>The spec to modify the URL of the request, before forwarding the request to the matched service.
urlRewrite is the only action supported in UrlMaps for classic Application Load Balancers.
Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.
weighted_backend_services: Vec<WeightedBackendService>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 oneweightedBackendService with weight set to a non-zero number.
After a backend service is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this HttpRouteAction.
Implementations§
Source§impl HttpRouteAction
impl HttpRouteAction
pub fn new() -> Self
Sourcepub fn set_cors_policy<T>(self, v: T) -> Selfwhere
T: Into<CorsPolicy>,
pub fn set_cors_policy<T>(self, v: T) -> Selfwhere
T: Into<CorsPolicy>,
Sets the value of cors_policy.
§Example
use google_cloud_compute_v1::model::CorsPolicy;
let x = HttpRouteAction::new().set_cors_policy(CorsPolicy::default()/* use setters */);Sourcepub fn set_or_clear_cors_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<CorsPolicy>,
pub fn set_or_clear_cors_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<CorsPolicy>,
Sets or clears the value of cors_policy.
§Example
use google_cloud_compute_v1::model::CorsPolicy;
let x = HttpRouteAction::new().set_or_clear_cors_policy(Some(CorsPolicy::default()/* use setters */));
let x = HttpRouteAction::new().set_or_clear_cors_policy(None::<CorsPolicy>);Sourcepub fn set_fault_injection_policy<T>(self, v: T) -> Selfwhere
T: Into<HttpFaultInjection>,
pub fn set_fault_injection_policy<T>(self, v: T) -> Selfwhere
T: Into<HttpFaultInjection>,
Sets the value of fault_injection_policy.
§Example
use google_cloud_compute_v1::model::HttpFaultInjection;
let x = HttpRouteAction::new().set_fault_injection_policy(HttpFaultInjection::default()/* use setters */);Sourcepub fn set_or_clear_fault_injection_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpFaultInjection>,
pub fn set_or_clear_fault_injection_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpFaultInjection>,
Sets or clears the value of fault_injection_policy.
§Example
use google_cloud_compute_v1::model::HttpFaultInjection;
let x = HttpRouteAction::new().set_or_clear_fault_injection_policy(Some(HttpFaultInjection::default()/* use setters */));
let x = HttpRouteAction::new().set_or_clear_fault_injection_policy(None::<HttpFaultInjection>);Sourcepub fn set_max_stream_duration<T>(self, v: T) -> Self
pub fn set_max_stream_duration<T>(self, v: T) -> Self
Sets the value of max_stream_duration.
§Example
use google_cloud_compute_v1::model::Duration;
let x = HttpRouteAction::new().set_max_stream_duration(Duration::default()/* use setters */);Sourcepub fn set_or_clear_max_stream_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_stream_duration<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_stream_duration.
§Example
use google_cloud_compute_v1::model::Duration;
let x = HttpRouteAction::new().set_or_clear_max_stream_duration(Some(Duration::default()/* use setters */));
let x = HttpRouteAction::new().set_or_clear_max_stream_duration(None::<Duration>);Sourcepub fn set_request_mirror_policy<T>(self, v: T) -> Selfwhere
T: Into<RequestMirrorPolicy>,
pub fn set_request_mirror_policy<T>(self, v: T) -> Selfwhere
T: Into<RequestMirrorPolicy>,
Sets the value of request_mirror_policy.
§Example
use google_cloud_compute_v1::model::RequestMirrorPolicy;
let x = HttpRouteAction::new().set_request_mirror_policy(RequestMirrorPolicy::default()/* use setters */);Sourcepub fn set_or_clear_request_mirror_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<RequestMirrorPolicy>,
pub fn set_or_clear_request_mirror_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<RequestMirrorPolicy>,
Sets or clears the value of request_mirror_policy.
§Example
use google_cloud_compute_v1::model::RequestMirrorPolicy;
let x = HttpRouteAction::new().set_or_clear_request_mirror_policy(Some(RequestMirrorPolicy::default()/* use setters */));
let x = HttpRouteAction::new().set_or_clear_request_mirror_policy(None::<RequestMirrorPolicy>);Sourcepub fn set_retry_policy<T>(self, v: T) -> Selfwhere
T: Into<HttpRetryPolicy>,
pub fn set_retry_policy<T>(self, v: T) -> Selfwhere
T: Into<HttpRetryPolicy>,
Sets the value of retry_policy.
§Example
use google_cloud_compute_v1::model::HttpRetryPolicy;
let x = HttpRouteAction::new().set_retry_policy(HttpRetryPolicy::default()/* use setters */);Sourcepub fn set_or_clear_retry_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpRetryPolicy>,
pub fn set_or_clear_retry_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpRetryPolicy>,
Sets or clears the value of retry_policy.
§Example
use google_cloud_compute_v1::model::HttpRetryPolicy;
let x = HttpRouteAction::new().set_or_clear_retry_policy(Some(HttpRetryPolicy::default()/* use setters */));
let x = HttpRouteAction::new().set_or_clear_retry_policy(None::<HttpRetryPolicy>);Sourcepub fn set_timeout<T>(self, v: T) -> Self
pub fn set_timeout<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_timeout<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_timeout<T>(self, v: Option<T>) -> Self
Sourcepub fn set_url_rewrite<T>(self, v: T) -> Selfwhere
T: Into<UrlRewrite>,
pub fn set_url_rewrite<T>(self, v: T) -> Selfwhere
T: Into<UrlRewrite>,
Sets the value of url_rewrite.
§Example
use google_cloud_compute_v1::model::UrlRewrite;
let x = HttpRouteAction::new().set_url_rewrite(UrlRewrite::default()/* use setters */);Sourcepub fn set_or_clear_url_rewrite<T>(self, v: Option<T>) -> Selfwhere
T: Into<UrlRewrite>,
pub fn set_or_clear_url_rewrite<T>(self, v: Option<T>) -> Selfwhere
T: Into<UrlRewrite>,
Sets or clears the value of url_rewrite.
§Example
use google_cloud_compute_v1::model::UrlRewrite;
let x = HttpRouteAction::new().set_or_clear_url_rewrite(Some(UrlRewrite::default()/* use setters */));
let x = HttpRouteAction::new().set_or_clear_url_rewrite(None::<UrlRewrite>);Sourcepub fn set_weighted_backend_services<T, V>(self, v: T) -> Self
pub fn set_weighted_backend_services<T, V>(self, v: T) -> Self
Sets the value of weighted_backend_services.
§Example
use google_cloud_compute_v1::model::WeightedBackendService;
let x = HttpRouteAction::new()
.set_weighted_backend_services([
WeightedBackendService::default()/* use setters */,
WeightedBackendService::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for HttpRouteAction
impl Clone for HttpRouteAction
Source§fn clone(&self) -> HttpRouteAction
fn clone(&self) -> HttpRouteAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more