Skip to main content

Backend

Struct Backend 

Source
#[non_exhaustive]
pub struct Backend {
Show 14 fields pub balancing_mode: Option<BalancingMode>, pub capacity_scaler: Option<f32>, pub custom_metrics: Vec<BackendCustomMetric>, pub description: Option<String>, pub failover: Option<bool>, pub group: Option<String>, pub max_connections: Option<i32>, pub max_connections_per_endpoint: Option<i32>, pub max_connections_per_instance: Option<i32>, pub max_rate: Option<i32>, pub max_rate_per_endpoint: Option<f32>, pub max_rate_per_instance: Option<f32>, pub max_utilization: Option<f32>, pub preference: Option<Preference>, /* private fields */
}
Available on crate features backend-services or region-backend-services only.
Expand description

Message containing information of one individual backend.

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.
§balancing_mode: Option<BalancingMode>

Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode.

Backends must use compatible balancing modes. For more information, see Supported balancing modes and target capacity settings and Restrictions and guidance for instance groups.

Note: Currently, if you use the API to configure incompatible balancing modes, the configuration might be accepted even though it has no impact and is ignored. Specifically, Backend.maxUtilization is ignored when Backend.balancingMode is RATE. In the future, this incompatible combination will be rejected.

§capacity_scaler: Option<f32>

A multiplier applied to the backend’s target capacity of its balancing mode. The default value is 1, which means the group serves up to 100% of its configured capacity (depending onbalancingMode). A setting of 0 means the group is completely drained, offering 0% of its available capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger than 0 and smaller than0.1. You cannot configure a setting of 0 when there is only one backend attached to the backend service.

Not available with backends that don’t support using abalancingMode. This includes backends such as global internet NEGs, regional serverless NEGs, and PSC NEGs.

§custom_metrics: Vec<BackendCustomMetric>

List of custom metrics that are used for CUSTOM_METRICS BalancingMode.

§description: Option<String>

An optional description of this resource. Provide this property when you create the resource.

§failover: Option<bool>

This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService.

§group: Option<String>

The fully-qualified URL of aninstance group or network endpoint group (NEG) resource. To determine what types of backends a load balancer supports, see the Backend services overview.

You must use the fully-qualified URL (starting withhttps://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported.

If haPolicy is specified, backends must refer to NEG resources of type GCE_VM_IP.

§max_connections: Option<i32>

Defines a target maximum number of simultaneous connections. For usage guidelines, seeConnection balancing mode and Utilization balancing mode. Not available if the backend’sbalancingMode is RATE.

§max_connections_per_endpoint: Option<i32>

Defines a target maximum number of simultaneous connections. For usage guidelines, seeConnection balancing mode and Utilization balancing mode.

Not available if the backend’s balancingMode isRATE.

§max_connections_per_instance: Option<i32>

Defines a target maximum number of simultaneous connections. For usage guidelines, seeConnection balancing mode and Utilization balancing mode.

Not available if the backend’s balancingMode isRATE.

§max_rate: Option<i32>

Defines a maximum number of HTTP requests per second (RPS). For usage guidelines, seeRate balancing mode and Utilization balancing mode.

Not available if the backend’s balancingMode isCONNECTION.

§max_rate_per_endpoint: Option<f32>

Defines a maximum target for requests per second (RPS). For usage guidelines, seeRate balancing mode and Utilization balancing mode.

Not available if the backend’s balancingMode isCONNECTION.

§max_rate_per_instance: Option<f32>

Defines a maximum target for requests per second (RPS). For usage guidelines, seeRate balancing mode and Utilization balancing mode.

Not available if the backend’s balancingMode isCONNECTION.

§max_utilization: Option<f32>

Optional parameter to define a target capacity for theUTILIZATION balancing mode. The valid range is[0.0, 1.0].

For usage guidelines, seeUtilization balancing mode.

§preference: Option<Preference>

This field indicates whether this backend should be fully utilized before sending traffic to backends with default preference. The possible values are:

  • PREFERRED: Backends with this preference level will be filled up to their capacity limits first, based on RTT.
  • DEFAULT: If preferred backends don’t have enough capacity, backends in this layer would be used and traffic would be assigned based on the load balancing algorithm you use. This is the default

Implementations§

Source§

impl Backend

Source

pub fn new() -> Self

Source

pub fn set_balancing_mode<T>(self, v: T) -> Self
where T: Into<BalancingMode>,

Sets the value of balancing_mode.

§Example
use google_cloud_compute_v1::model::backend::BalancingMode;
let x0 = Backend::new().set_balancing_mode(BalancingMode::CustomMetrics);
let x1 = Backend::new().set_balancing_mode(BalancingMode::Rate);
let x2 = Backend::new().set_balancing_mode(BalancingMode::Utilization);
Source

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

Sets or clears the value of balancing_mode.

§Example
use google_cloud_compute_v1::model::backend::BalancingMode;
let x0 = Backend::new().set_or_clear_balancing_mode(Some(BalancingMode::CustomMetrics));
let x1 = Backend::new().set_or_clear_balancing_mode(Some(BalancingMode::Rate));
let x2 = Backend::new().set_or_clear_balancing_mode(Some(BalancingMode::Utilization));
let x_none = Backend::new().set_or_clear_balancing_mode(None::<BalancingMode>);
Source

pub fn set_capacity_scaler<T>(self, v: T) -> Self
where T: Into<f32>,

Sets the value of capacity_scaler.

§Example
let x = Backend::new().set_capacity_scaler(42.0);
Source

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

Sets or clears the value of capacity_scaler.

§Example
let x = Backend::new().set_or_clear_capacity_scaler(Some(42.0));
let x = Backend::new().set_or_clear_capacity_scaler(None::<f32>);
Source

pub fn set_custom_metrics<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<BackendCustomMetric>,

Sets the value of custom_metrics.

§Example
use google_cloud_compute_v1::model::BackendCustomMetric;
let x = Backend::new()
    .set_custom_metrics([
        BackendCustomMetric::default()/* use setters */,
        BackendCustomMetric::default()/* use (different) setters */,
    ]);
Source

pub fn set_description<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of description.

§Example
let x = Backend::new().set_description("example");
Source

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

Sets or clears the value of description.

§Example
let x = Backend::new().set_or_clear_description(Some("example"));
let x = Backend::new().set_or_clear_description(None::<String>);
Source

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

Sets the value of failover.

§Example
let x = Backend::new().set_failover(true);
Source

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

Sets or clears the value of failover.

§Example
let x = Backend::new().set_or_clear_failover(Some(false));
let x = Backend::new().set_or_clear_failover(None::<bool>);
Source

pub fn set_group<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of group.

§Example
let x = Backend::new().set_group("example");
Source

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

Sets or clears the value of group.

§Example
let x = Backend::new().set_or_clear_group(Some("example"));
let x = Backend::new().set_or_clear_group(None::<String>);
Source

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

Sets the value of max_connections.

§Example
let x = Backend::new().set_max_connections(42);
Source

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

Sets or clears the value of max_connections.

§Example
let x = Backend::new().set_or_clear_max_connections(Some(42));
let x = Backend::new().set_or_clear_max_connections(None::<i32>);
Source

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

Sets the value of max_connections_per_endpoint.

§Example
let x = Backend::new().set_max_connections_per_endpoint(42);
Source

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

Sets or clears the value of max_connections_per_endpoint.

§Example
let x = Backend::new().set_or_clear_max_connections_per_endpoint(Some(42));
let x = Backend::new().set_or_clear_max_connections_per_endpoint(None::<i32>);
Source

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

Sets the value of max_connections_per_instance.

§Example
let x = Backend::new().set_max_connections_per_instance(42);
Source

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

Sets or clears the value of max_connections_per_instance.

§Example
let x = Backend::new().set_or_clear_max_connections_per_instance(Some(42));
let x = Backend::new().set_or_clear_max_connections_per_instance(None::<i32>);
Source

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

Sets the value of max_rate.

§Example
let x = Backend::new().set_max_rate(42);
Source

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

Sets or clears the value of max_rate.

§Example
let x = Backend::new().set_or_clear_max_rate(Some(42));
let x = Backend::new().set_or_clear_max_rate(None::<i32>);
Source

pub fn set_max_rate_per_endpoint<T>(self, v: T) -> Self
where T: Into<f32>,

Sets the value of max_rate_per_endpoint.

§Example
let x = Backend::new().set_max_rate_per_endpoint(42.0);
Source

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

Sets or clears the value of max_rate_per_endpoint.

§Example
let x = Backend::new().set_or_clear_max_rate_per_endpoint(Some(42.0));
let x = Backend::new().set_or_clear_max_rate_per_endpoint(None::<f32>);
Source

pub fn set_max_rate_per_instance<T>(self, v: T) -> Self
where T: Into<f32>,

Sets the value of max_rate_per_instance.

§Example
let x = Backend::new().set_max_rate_per_instance(42.0);
Source

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

Sets or clears the value of max_rate_per_instance.

§Example
let x = Backend::new().set_or_clear_max_rate_per_instance(Some(42.0));
let x = Backend::new().set_or_clear_max_rate_per_instance(None::<f32>);
Source

pub fn set_max_utilization<T>(self, v: T) -> Self
where T: Into<f32>,

Sets the value of max_utilization.

§Example
let x = Backend::new().set_max_utilization(42.0);
Source

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

Sets or clears the value of max_utilization.

§Example
let x = Backend::new().set_or_clear_max_utilization(Some(42.0));
let x = Backend::new().set_or_clear_max_utilization(None::<f32>);
Source

pub fn set_preference<T>(self, v: T) -> Self
where T: Into<Preference>,

Sets the value of preference.

§Example
use google_cloud_compute_v1::model::backend::Preference;
let x0 = Backend::new().set_preference(Preference::Unspecified);
let x1 = Backend::new().set_preference(Preference::Preferred);
Source

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

Sets or clears the value of preference.

§Example
use google_cloud_compute_v1::model::backend::Preference;
let x0 = Backend::new().set_or_clear_preference(Some(Preference::Unspecified));
let x1 = Backend::new().set_or_clear_preference(Some(Preference::Preferred));
let x_none = Backend::new().set_or_clear_preference(None::<Preference>);

Trait Implementations§

Source§

impl Clone for Backend

Source§

fn clone(&self) -> Backend

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 Backend

Source§

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

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

impl Default for Backend

Source§

fn default() -> Backend

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

impl Message for Backend

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Backend

Source§

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

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