#[non_exhaustive]pub struct BackendServiceConnectionTrackingPolicy {
pub connection_persistence_on_unhealthy_backends: Option<ConnectionPersistenceOnUnhealthyBackends>,
pub enable_strong_affinity: Option<bool>,
pub idle_timeout_sec: Option<i32>,
pub tracking_mode: Option<TrackingMode>,
/* private fields */
}backend-services or region-backend-services only.Expand description
Connection Tracking configuration for this BackendService.
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.connection_persistence_on_unhealthy_backends: Option<ConnectionPersistenceOnUnhealthyBackends>Specifies connection persistence when backends are unhealthy. The default value is DEFAULT_FOR_PROTOCOL.
If set to DEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy backends only for connection-oriented protocols (TCP and SCTP) and only if the Tracking Mode isPER_CONNECTION (default tracking mode) or the Session Affinity is configured for 5-tuple. They do not persist forUDP.
If set to NEVER_PERSIST, after a backend becomes unhealthy, the existing connections on the unhealthy backend are never persisted on the unhealthy backend. They are always diverted to newly selected healthy backends (unless all backends are unhealthy).
If set to ALWAYS_PERSIST, existing connections always persist on unhealthy backends regardless of protocol and session affinity. It is generally not recommended to use this mode overriding the default.
For more details, see Connection Persistence for Network Load Balancing and Connection Persistence for Internal TCP/UDP Load Balancing.
enable_strong_affinity: Option<bool>Enable Strong Session Affinity for external passthrough Network Load Balancers. This option is not available publicly.
idle_timeout_sec: Option<i32>Specifies how long to keep a Connection Tracking entry while there is no matching traffic (in seconds).
For internal passthrough Network Load Balancers:
- The minimum (default) is 10 minutes and the maximum is 16 hours.
- It can be set only if Connection Tracking is less than 5-tuple (i.e. Session Affinity is CLIENT_IP_NO_DESTINATION,CLIENT_IP or CLIENT_IP_PROTO, and Tracking Mode is PER_SESSION).
For external passthrough Network Load Balancers the default is 60 seconds. This option is not available publicly.
tracking_mode: Option<TrackingMode>Specifies the key used for connection tracking. There are two options:
- PER_CONNECTION: This is the default mode. The Connection Tracking is performed as per the Connection Key (default Hash Method) for the specific protocol.
- PER_SESSION: The Connection Tracking is performed as per the configured Session Affinity. It matches the configured Session Affinity.
For more details, see Tracking Mode for Network Load Balancing and Tracking Mode for Internal TCP/UDP Load Balancing.
Implementations§
Source§impl BackendServiceConnectionTrackingPolicy
impl BackendServiceConnectionTrackingPolicy
pub fn new() -> Self
Sourcepub fn set_connection_persistence_on_unhealthy_backends<T>(self, v: T) -> Selfwhere
T: Into<ConnectionPersistenceOnUnhealthyBackends>,
pub fn set_connection_persistence_on_unhealthy_backends<T>(self, v: T) -> Selfwhere
T: Into<ConnectionPersistenceOnUnhealthyBackends>,
Sets the value of connection_persistence_on_unhealthy_backends.
§Example
use google_cloud_compute_v1::model::backend_service_connection_tracking_policy::ConnectionPersistenceOnUnhealthyBackends;
let x0 = BackendServiceConnectionTrackingPolicy::new().set_connection_persistence_on_unhealthy_backends(ConnectionPersistenceOnUnhealthyBackends::DefaultForProtocol);
let x1 = BackendServiceConnectionTrackingPolicy::new().set_connection_persistence_on_unhealthy_backends(ConnectionPersistenceOnUnhealthyBackends::NeverPersist);Sourcepub fn set_or_clear_connection_persistence_on_unhealthy_backends<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<ConnectionPersistenceOnUnhealthyBackends>,
pub fn set_or_clear_connection_persistence_on_unhealthy_backends<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<ConnectionPersistenceOnUnhealthyBackends>,
Sets or clears the value of connection_persistence_on_unhealthy_backends.
§Example
use google_cloud_compute_v1::model::backend_service_connection_tracking_policy::ConnectionPersistenceOnUnhealthyBackends;
let x0 = BackendServiceConnectionTrackingPolicy::new().set_or_clear_connection_persistence_on_unhealthy_backends(Some(ConnectionPersistenceOnUnhealthyBackends::DefaultForProtocol));
let x1 = BackendServiceConnectionTrackingPolicy::new().set_or_clear_connection_persistence_on_unhealthy_backends(Some(ConnectionPersistenceOnUnhealthyBackends::NeverPersist));
let x_none = BackendServiceConnectionTrackingPolicy::new().set_or_clear_connection_persistence_on_unhealthy_backends(None::<ConnectionPersistenceOnUnhealthyBackends>);Sourcepub fn set_enable_strong_affinity<T>(self, v: T) -> Self
pub fn set_enable_strong_affinity<T>(self, v: T) -> Self
Sets the value of enable_strong_affinity.
§Example
let x = BackendServiceConnectionTrackingPolicy::new().set_enable_strong_affinity(true);Sourcepub fn set_or_clear_enable_strong_affinity<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_enable_strong_affinity<T>(self, v: Option<T>) -> Self
Sets or clears the value of enable_strong_affinity.
§Example
let x = BackendServiceConnectionTrackingPolicy::new().set_or_clear_enable_strong_affinity(Some(false));
let x = BackendServiceConnectionTrackingPolicy::new().set_or_clear_enable_strong_affinity(None::<bool>);Sourcepub fn set_idle_timeout_sec<T>(self, v: T) -> Self
pub fn set_idle_timeout_sec<T>(self, v: T) -> Self
Sets the value of idle_timeout_sec.
§Example
let x = BackendServiceConnectionTrackingPolicy::new().set_idle_timeout_sec(42);Sourcepub fn set_or_clear_idle_timeout_sec<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_idle_timeout_sec<T>(self, v: Option<T>) -> Self
Sets or clears the value of idle_timeout_sec.
§Example
let x = BackendServiceConnectionTrackingPolicy::new().set_or_clear_idle_timeout_sec(Some(42));
let x = BackendServiceConnectionTrackingPolicy::new().set_or_clear_idle_timeout_sec(None::<i32>);Sourcepub fn set_tracking_mode<T>(self, v: T) -> Selfwhere
T: Into<TrackingMode>,
pub fn set_tracking_mode<T>(self, v: T) -> Selfwhere
T: Into<TrackingMode>,
Sets the value of tracking_mode.
§Example
use google_cloud_compute_v1::model::backend_service_connection_tracking_policy::TrackingMode;
let x0 = BackendServiceConnectionTrackingPolicy::new().set_tracking_mode(TrackingMode::PerConnection);
let x1 = BackendServiceConnectionTrackingPolicy::new().set_tracking_mode(TrackingMode::PerSession);Sourcepub fn set_or_clear_tracking_mode<T>(self, v: Option<T>) -> Selfwhere
T: Into<TrackingMode>,
pub fn set_or_clear_tracking_mode<T>(self, v: Option<T>) -> Selfwhere
T: Into<TrackingMode>,
Sets or clears the value of tracking_mode.
§Example
use google_cloud_compute_v1::model::backend_service_connection_tracking_policy::TrackingMode;
let x0 = BackendServiceConnectionTrackingPolicy::new().set_or_clear_tracking_mode(Some(TrackingMode::PerConnection));
let x1 = BackendServiceConnectionTrackingPolicy::new().set_or_clear_tracking_mode(Some(TrackingMode::PerSession));
let x_none = BackendServiceConnectionTrackingPolicy::new().set_or_clear_tracking_mode(None::<TrackingMode>);Trait Implementations§
Source§impl Clone for BackendServiceConnectionTrackingPolicy
impl Clone for BackendServiceConnectionTrackingPolicy
Source§fn clone(&self) -> BackendServiceConnectionTrackingPolicy
fn clone(&self) -> BackendServiceConnectionTrackingPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for BackendServiceConnectionTrackingPolicy
impl Default for BackendServiceConnectionTrackingPolicy
Source§fn default() -> BackendServiceConnectionTrackingPolicy
fn default() -> BackendServiceConnectionTrackingPolicy
Source§impl PartialEq for BackendServiceConnectionTrackingPolicy
impl PartialEq for BackendServiceConnectionTrackingPolicy
Source§fn eq(&self, other: &BackendServiceConnectionTrackingPolicy) -> bool
fn eq(&self, other: &BackendServiceConnectionTrackingPolicy) -> bool
self and other values to be equal, and is used by ==.