BackendServiceHAPolicy

Struct BackendServiceHAPolicy 

Source
#[non_exhaustive]
pub struct BackendServiceHAPolicy { pub fast_ip_move: Option<FastIpmove>, pub leader: Option<BackendServiceHAPolicyLeader>, /* private fields */ }
Available on crate features backend-services or region-backend-services only.

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.
§fast_ip_move: Option<FastIpmove>

Specifies whether fast IP move is enabled, and if so, the mechanism to achieve it.

Supported values are:

  • DISABLED: Fast IP Move is disabled. You can only use the haPolicy.leader API to update the leader.

GARP_RA: Provides a method to very quickly define a new network endpoint as the leader. This method is faster than updating the leader using the haPolicy.leader API. Fast IP move works as follows: The VM hosting the network endpoint that should become the new leader sends either a Gratuitous ARP (GARP) packet (IPv4) or an ICMPv6 Router Advertisement(RA) packet (IPv6). Google Cloud immediately but temporarily associates the forwarding rule IP address with that VM, and both new and in-flight packets are quickly delivered to that VM.

Note the important properties of the Fast IP Move functionality:

  • The GARP/RA-initiated re-routing stays active for approximately 20 minutes. After triggering fast failover, you must also appropriately set the haPolicy.leader.
  • The new leader instance should continue to send GARP/RA packets periodically every 10 seconds until at least 10 minutes after updating the haPolicy.leader (but stop immediately if it is no longer the leader).
  • After triggering a fast failover, we recommend that you wait at least 3 seconds before sending another GARP/RA packet from a different VM instance to avoid race conditions.
  • Don’t send GARP/RA packets from different VM instances at the same time. If multiple instances continue to send GARP/RA packets, traffic might be routed to different destinations in an alternating order. This condition ceases when a single instance issues a GARP/RA packet.
  • The GARP/RA request always takes priority over the leader API. Using the haPolicy.leader API to change the leader to a different instance will have no effect until the GARP/RA request becomes inactive.
  • The GARP/RA packets should follow the GARP/RA Packet Specifications..
  • When multiple forwarding rules refer to a regional backend service, you need only send a GARP or RA packet for a single forwarding rule virtual IP. The virtual IPs for all forwarding rules targeting the same backend service will also be moved to the sender of the GARP or RA packet.

The following are the Fast IP Move limitations (that is, when fastIPMove is not DISABLED):

  • Multiple forwarding rules cannot use the same IP address if one of them refers to a regional backend service with fastIPMove.
  • The regional backend service must set the network field, and all NEGs must belong to that network. However, individual NEGs can belong to different subnetworks of that network.
  • The maximum number of network endpoints across all backends of a backend service with fastIPMove is 32.
  • The maximum number of backend services with fastIPMove that can have the same network endpoint attached to one of its backends is 64.
  • The maximum number of backend services with fastIPMove in a VPC in a region is 64.
  • The network endpoints that are attached to a backend of a backend service with fastIPMove cannot resolve to Gen3+ machines for IPv6.
  • Traffic directed to the leader by a static route next hop will not be redirected to a new leader by fast failover. Such traffic will only be redirected once an haPolicy.leader update has taken effect. Only traffic to the forwarding rule’s virtual IP will be redirected to a new leader by fast failover.

haPolicy.fastIPMove can be set only at backend service creation time. Once set, it cannot be updated.

By default, fastIpMove is set to DISABLED.

§leader: Option<BackendServiceHAPolicyLeader>

Selects one of the network endpoints attached to the backend NEGs of this service as the active endpoint (the leader) that receives all traffic.

When the leader changes, there is no connection draining to persist existing connections on the old leader.

You are responsible for selecting a suitable endpoint as the leader. For example, preferring a healthy endpoint over unhealthy ones. Note that this service does not track backend endpoint health, and selects the configured leader unconditionally.

Implementations§

Source§

impl BackendServiceHAPolicy

Source

pub fn new() -> Self

Source

pub fn set_fast_ip_move<T>(self, v: T) -> Self
where T: Into<FastIpmove>,

Sets the value of fast_ip_move.

§Example
use google_cloud_compute_v1::model::backend_service_ha_policy::FastIpmove;
let x0 = BackendServiceHAPolicy::new().set_fast_ip_move(FastIpmove::GarpRa);
Source

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

Sets or clears the value of fast_ip_move.

§Example
use google_cloud_compute_v1::model::backend_service_ha_policy::FastIpmove;
let x0 = BackendServiceHAPolicy::new().set_or_clear_fast_ip_move(Some(FastIpmove::GarpRa));
let x_none = BackendServiceHAPolicy::new().set_or_clear_fast_ip_move(None::<FastIpmove>);
Source

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

Sets the value of leader.

§Example
use google_cloud_compute_v1::model::BackendServiceHAPolicyLeader;
let x = BackendServiceHAPolicy::new().set_leader(BackendServiceHAPolicyLeader::default()/* use setters */);
Source

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

Sets or clears the value of leader.

§Example
use google_cloud_compute_v1::model::BackendServiceHAPolicyLeader;
let x = BackendServiceHAPolicy::new().set_or_clear_leader(Some(BackendServiceHAPolicyLeader::default()/* use setters */));
let x = BackendServiceHAPolicy::new().set_or_clear_leader(None::<BackendServiceHAPolicyLeader>);

Trait Implementations§

Source§

impl Clone for BackendServiceHAPolicy

Source§

fn clone(&self) -> BackendServiceHAPolicy

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 BackendServiceHAPolicy

Source§

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

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

impl Default for BackendServiceHAPolicy

Source§

fn default() -> BackendServiceHAPolicy

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

impl Message for BackendServiceHAPolicy

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for BackendServiceHAPolicy

Source§

fn eq(&self, other: &BackendServiceHAPolicy) -> 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 BackendServiceHAPolicy

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>,