Skip to main content

BackendServiceConnectionTrackingPolicy

Struct BackendServiceConnectionTrackingPolicy 

Source
#[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 */ }
Available on crate features 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

Source

pub fn new() -> Self

Source

pub fn set_connection_persistence_on_unhealthy_backends<T>(self, v: T) -> Self

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);
Source

pub fn set_or_clear_connection_persistence_on_unhealthy_backends<T>( self, v: Option<T>, ) -> Self

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>);
Source

pub fn set_enable_strong_affinity<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of enable_strong_affinity.

§Example
let x = BackendServiceConnectionTrackingPolicy::new().set_enable_strong_affinity(true);
Source

pub fn set_or_clear_enable_strong_affinity<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

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>);
Source

pub fn set_idle_timeout_sec<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of idle_timeout_sec.

§Example
let x = BackendServiceConnectionTrackingPolicy::new().set_idle_timeout_sec(42);
Source

pub fn set_or_clear_idle_timeout_sec<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

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>);
Source

pub fn set_tracking_mode<T>(self, v: T) -> Self
where 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);
Source

pub fn set_or_clear_tracking_mode<T>(self, v: Option<T>) -> Self
where 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

Source§

fn clone(&self) -> BackendServiceConnectionTrackingPolicy

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BackendServiceConnectionTrackingPolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BackendServiceConnectionTrackingPolicy

Source§

fn default() -> BackendServiceConnectionTrackingPolicy

Returns the “default value” for a type. Read more
Source§

impl Message for BackendServiceConnectionTrackingPolicy

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for BackendServiceConnectionTrackingPolicy

Source§

fn eq(&self, other: &BackendServiceConnectionTrackingPolicy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BackendServiceConnectionTrackingPolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,