#[non_exhaustive]pub struct BackendServiceFailoverPolicy {
pub disable_connection_drain_on_failover: Option<bool>,
pub drop_traffic_if_unhealthy: Option<bool>,
pub failover_ratio: Option<f32>,
/* private fields */
}backend-services or region-backend-services only.Expand description
For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers. On failover or failback, this field indicates whether connection draining will be honored. Google Cloud has a fixed connection draining timeout of 10 minutes. A setting of true terminates existing TCP connections to the active pool during failover and failback, immediately draining traffic. A setting of false allows existing TCP connections to persist, even on VMs no longer in the active pool, for up to the duration of the connection draining timeout (10 minutes).
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.disable_connection_drain_on_failover: Option<bool>This can be set to true only if the protocol isTCP.
The default is false.
drop_traffic_if_unhealthy: Option<bool>If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy.If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. For load balancers that have configurable failover: Internal passthrough Network Load Balancers and external passthrough Network Load Balancers. The default is false.
failover_ratio: Option<f32>The value of the field must be in the range[0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. For load balancers that have configurable failover: Internal TCP/UDP Load Balancing and external TCP/UDP Load Balancing.
Implementations§
Source§impl BackendServiceFailoverPolicy
impl BackendServiceFailoverPolicy
pub fn new() -> Self
Sourcepub fn set_disable_connection_drain_on_failover<T>(self, v: T) -> Self
pub fn set_disable_connection_drain_on_failover<T>(self, v: T) -> Self
Sets the value of disable_connection_drain_on_failover.
§Example
let x = BackendServiceFailoverPolicy::new().set_disable_connection_drain_on_failover(true);Sourcepub fn set_or_clear_disable_connection_drain_on_failover<T>(
self,
v: Option<T>,
) -> Self
pub fn set_or_clear_disable_connection_drain_on_failover<T>( self, v: Option<T>, ) -> Self
Sets or clears the value of disable_connection_drain_on_failover.
§Example
let x = BackendServiceFailoverPolicy::new().set_or_clear_disable_connection_drain_on_failover(Some(false));
let x = BackendServiceFailoverPolicy::new().set_or_clear_disable_connection_drain_on_failover(None::<bool>);Sourcepub fn set_drop_traffic_if_unhealthy<T>(self, v: T) -> Self
pub fn set_drop_traffic_if_unhealthy<T>(self, v: T) -> Self
Sets the value of drop_traffic_if_unhealthy.
§Example
let x = BackendServiceFailoverPolicy::new().set_drop_traffic_if_unhealthy(true);Sourcepub fn set_or_clear_drop_traffic_if_unhealthy<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_drop_traffic_if_unhealthy<T>(self, v: Option<T>) -> Self
Sets or clears the value of drop_traffic_if_unhealthy.
§Example
let x = BackendServiceFailoverPolicy::new().set_or_clear_drop_traffic_if_unhealthy(Some(false));
let x = BackendServiceFailoverPolicy::new().set_or_clear_drop_traffic_if_unhealthy(None::<bool>);Sourcepub fn set_failover_ratio<T>(self, v: T) -> Self
pub fn set_failover_ratio<T>(self, v: T) -> Self
Sets the value of failover_ratio.
§Example
let x = BackendServiceFailoverPolicy::new().set_failover_ratio(42.0);Sourcepub fn set_or_clear_failover_ratio<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_failover_ratio<T>(self, v: Option<T>) -> Self
Sets or clears the value of failover_ratio.
§Example
let x = BackendServiceFailoverPolicy::new().set_or_clear_failover_ratio(Some(42.0));
let x = BackendServiceFailoverPolicy::new().set_or_clear_failover_ratio(None::<f32>);Trait Implementations§
Source§impl Clone for BackendServiceFailoverPolicy
impl Clone for BackendServiceFailoverPolicy
Source§fn clone(&self) -> BackendServiceFailoverPolicy
fn clone(&self) -> BackendServiceFailoverPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendServiceFailoverPolicy
impl Debug for BackendServiceFailoverPolicy
Source§impl Default for BackendServiceFailoverPolicy
impl Default for BackendServiceFailoverPolicy
Source§fn default() -> BackendServiceFailoverPolicy
fn default() -> BackendServiceFailoverPolicy
Source§impl PartialEq for BackendServiceFailoverPolicy
impl PartialEq for BackendServiceFailoverPolicy
Source§fn eq(&self, other: &BackendServiceFailoverPolicy) -> bool
fn eq(&self, other: &BackendServiceFailoverPolicy) -> bool
self and other values to be equal, and is used by ==.