#[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 */
}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
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
impl Backend
pub fn new() -> Self
Sourcepub fn set_balancing_mode<T>(self, v: T) -> Selfwhere
T: Into<BalancingMode>,
pub fn set_balancing_mode<T>(self, v: T) -> Selfwhere
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);Sourcepub fn set_or_clear_balancing_mode<T>(self, v: Option<T>) -> Selfwhere
T: Into<BalancingMode>,
pub fn set_or_clear_balancing_mode<T>(self, v: Option<T>) -> Selfwhere
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>);Sourcepub fn set_capacity_scaler<T>(self, v: T) -> Self
pub fn set_capacity_scaler<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_capacity_scaler<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_capacity_scaler<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_custom_metrics<T, V>(self, v: T) -> Self
pub fn set_custom_metrics<T, V>(self, v: T) -> Self
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 */,
]);Sourcepub fn set_description<T>(self, v: T) -> Self
pub fn set_description<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_failover<T>(self, v: T) -> Self
pub fn set_failover<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_failover<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_failover<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_group<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_group<T>(self, v: Option<T>) -> Self
Sourcepub fn set_max_connections<T>(self, v: T) -> Self
pub fn set_max_connections<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_max_connections<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_connections<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_max_connections_per_endpoint<T>(self, v: T) -> Self
pub fn set_max_connections_per_endpoint<T>(self, v: T) -> Self
Sets the value of max_connections_per_endpoint.
§Example
let x = Backend::new().set_max_connections_per_endpoint(42);Sourcepub fn set_or_clear_max_connections_per_endpoint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_connections_per_endpoint<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_max_connections_per_instance<T>(self, v: T) -> Self
pub fn set_max_connections_per_instance<T>(self, v: T) -> Self
Sets the value of max_connections_per_instance.
§Example
let x = Backend::new().set_max_connections_per_instance(42);Sourcepub fn set_or_clear_max_connections_per_instance<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_connections_per_instance<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_max_rate<T>(self, v: T) -> Self
pub fn set_max_rate<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_max_rate<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_rate<T>(self, v: Option<T>) -> Self
Sourcepub fn set_max_rate_per_endpoint<T>(self, v: T) -> Self
pub fn set_max_rate_per_endpoint<T>(self, v: T) -> Self
Sets the value of max_rate_per_endpoint.
§Example
let x = Backend::new().set_max_rate_per_endpoint(42.0);Sourcepub fn set_or_clear_max_rate_per_endpoint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_rate_per_endpoint<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_max_rate_per_instance<T>(self, v: T) -> Self
pub fn set_max_rate_per_instance<T>(self, v: T) -> Self
Sets the value of max_rate_per_instance.
§Example
let x = Backend::new().set_max_rate_per_instance(42.0);Sourcepub fn set_or_clear_max_rate_per_instance<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_rate_per_instance<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_max_utilization<T>(self, v: T) -> Self
pub fn set_max_utilization<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_max_utilization<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_utilization<T>(self, v: Option<T>) -> Self
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>);Sourcepub fn set_preference<T>(self, v: T) -> Selfwhere
T: Into<Preference>,
pub fn set_preference<T>(self, v: T) -> Selfwhere
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);Sourcepub fn set_or_clear_preference<T>(self, v: Option<T>) -> Selfwhere
T: Into<Preference>,
pub fn set_or_clear_preference<T>(self, v: Option<T>) -> Selfwhere
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>);