Skip to main content

LoadBalancerRequest

Type Alias LoadBalancerRequest 

Source
pub type LoadBalancerRequest<M, V> = Request<M, V>;
Expand description

A type alias with Request<_, LoadBalancer> specific functions.

Aliased Type§

pub struct LoadBalancerRequest<M, V> { /* private fields */ }

Implementations§

Source§

impl LoadBalancerRequest<Create, LoadBalancer>

Source

pub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Create, LoadBalancer>
where S: Display + Serialize,

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either “round_robin” or “least_connections”. The default value is “round_robin”.

Digital Ocean Documentation.

Source

pub fn forwarding_rule<T>( self, val: T, ) -> LoadBalancerRequest<Create, LoadBalancer>
where T: Into<ForwardingRule>,

An array of objects specifying the forwarding rules for a Load Balancer. At least one forwarding rule is required when creating a new Load Balancer instance.

Digital Ocean Documentation.

Source

pub fn health_check<S: AsRef<str> + Display + Serialize>( self, protocol: S, port: usize, path: Option<S>, check_interval_seconds: Option<usize>, response_timeout_seconds: Option<usize>, unhealthy_threshold: Option<usize>, healthy_threshold: Option<usize>, ) -> LoadBalancerRequest<Create, LoadBalancer>

The (optional) health check settings.

Digital Ocean Documentation.

Source

pub fn sticky_sessions<S: AsRef<str> + Display + Serialize>( self, kind: S, cookie_name: Option<S>, cookie_ttl_seconds: Option<usize>, ) -> LoadBalancerRequest<Create, LoadBalancer>

The (optional) sticky sessions settings. kind must be cookies or none. If kind is cookies then cookie_name and cookie_ttl_seconds should be set as well.

Digital Ocean Documentation.

Source

pub fn redirect_http_to_https( self, setting: bool, ) -> LoadBalancerRequest<Create, LoadBalancer>

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

Digital Ocean Documentation.

Source

pub fn droplets( self, ids: Vec<usize>, ) -> LoadBalancerRequest<Create, LoadBalancer>

The IDs of the Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the tag function.

Digital Ocean Documentation.

Source

pub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Create, LoadBalancer>
where S: AsRef<str> + Display + Serialize,

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the droplets function.

Digital Ocean Documentation.

Source§

impl LoadBalancerRequest<Update, LoadBalancer>

Source

pub fn name<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>
where S: Display + Serialize,

A human-readable name for a Load Balancer instance.

Digital Ocean Documentation.

Source

pub fn region<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>
where S: Display + Serialize,

The region where the Load Balancer instance will be located.

Digital Ocean Documentation.

Source

pub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>
where S: Display + Serialize,

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either “round_robin” or “least_connections”. The default value is “round_robin”.

Digital Ocean Documentation.

Source

pub fn forwarding_rule<T>( self, val: T, ) -> LoadBalancerRequest<Update, LoadBalancer>
where T: Into<ForwardingRule>,

An array of objects specifying the forwarding rules for a Load Balancer. At least one forwarding rule is required when creating a new Load Balancer instance.

Digital Ocean Documentation.

Source

pub fn health_check<S: AsRef<str> + Display + Serialize>( self, protocol: S, port: usize, path: Option<S>, check_interval_seconds: Option<usize>, response_timeout_seconds: Option<usize>, unhealthy_threshold: Option<usize>, healthy_threshold: Option<usize>, ) -> LoadBalancerRequest<Update, LoadBalancer>

The (optional) health check settings.

Digital Ocean Documentation.

Source

pub fn sticky_sessions<S: AsRef<str> + Display + Serialize>( self, kind: S, cookie_name: Option<S>, cookie_ttl_seconds: Option<usize>, ) -> LoadBalancerRequest<Update, LoadBalancer>

The (optional) sticky sessions settings. kind must be cookies or none. If kind is cookies then cookie_name and cookie_ttl_seconds should be set as well.

Digital Ocean Documentation.

Source

pub fn redirect_http_to_https( self, setting: bool, ) -> LoadBalancerRequest<Update, LoadBalancer>

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

Digital Ocean Documentation.

Source

pub fn droplets( self, ids: Vec<usize>, ) -> LoadBalancerRequest<Update, LoadBalancer>

The IDs of the Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the tag function.

Digital Ocean Documentation.

Source

pub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Update, LoadBalancer>
where S: AsRef<str> + Display + Serialize,

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the droplets function.

Digital Ocean Documentation.

Source§

impl LoadBalancerRequest<Get, LoadBalancer>

Source

pub fn add_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Create, ()>

Add droplets (by id) to the load balancer.

Digital Ocean Documentation.

Source

pub fn remove_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Delete, ()>

Remove droplets (by id) from the load balancer.

Digital Ocean Documentation.

Source

pub fn add_forwarding_rules<T>( self, items: Vec<T>, ) -> LoadBalancerRequest<Create, ()>
where T: Into<ForwardingRule>,

Add a forwarding rule to the Load Balancer.

Digital Ocean Documentation.

Source

pub fn remove_forwarding_rules<T>( self, items: Vec<T>, ) -> LoadBalancerRequest<Delete, ()>
where T: Into<ForwardingRule>,

Remove a forwarding rule to the Load Balancer.

Digital Ocean Documentation.