Struct haproxy_api::Server
source · pub struct Server<'lua> {
pub name: String,
pub puid: String,
/* private fields */
}Expand description
The “Server” class provides a way for manipulating servers and retrieving information.
Fields§
§name: String§puid: StringImplementations§
source§impl<'lua> Server<'lua>
impl<'lua> Server<'lua>
sourcepub fn is_draining(&self) -> Result<bool>
pub fn is_draining(&self) -> Result<bool>
Returns true if the server is currently draining sticky connections.
sourcepub fn set_maxconn(&self, maxconn: u64) -> Result<()>
pub fn set_maxconn(&self, maxconn: u64) -> Result<()>
Dynamically changes the maximum connections of the server.
sourcepub fn get_maxconn(&self) -> Result<u64>
pub fn get_maxconn(&self) -> Result<u64>
Returns an integer representing the server maximum connections.
sourcepub fn set_weight(&self, weight: &str) -> Result<()>
pub fn set_weight(&self, weight: &str) -> Result<()>
Dynamically changes the weight of the server. See the management socket documentation for more information about the format of the string.
sourcepub fn get_weight(&self) -> Result<u32>
pub fn get_weight(&self) -> Result<u32>
Returns an integer representing the server weight.
sourcepub fn set_addr(&self, addr: String, port: Option<u16>) -> Result<()>
pub fn set_addr(&self, addr: String, port: Option<u16>) -> Result<()>
Dynamically changes the address of the server.
sourcepub fn get_addr(&self) -> Result<String>
pub fn get_addr(&self) -> Result<String>
Returns a string describing the address of the server.
sourcepub fn get_stats(&self) -> Result<Table<'lua>>
pub fn get_stats(&self) -> Result<Table<'lua>>
Returns a table containing the server statistics.
sourcepub fn check_enable(&self) -> Result<()>
pub fn check_enable(&self) -> Result<()>
Enables health checks.
sourcepub fn check_disable(&self) -> Result<()>
pub fn check_disable(&self) -> Result<()>
Disables health checks.
sourcepub fn check_force_up(&self) -> Result<()>
pub fn check_force_up(&self) -> Result<()>
Forces health-check up.
sourcepub fn check_force_nolb(&self) -> Result<()>
pub fn check_force_nolb(&self) -> Result<()>
Forces health-check nolb mode.
sourcepub fn check_force_down(&self) -> Result<()>
pub fn check_force_down(&self) -> Result<()>
Forces health-check down.
sourcepub fn agent_enable(&self) -> Result<()>
pub fn agent_enable(&self) -> Result<()>
Enables agent check.
sourcepub fn agent_disable(&self) -> Result<()>
pub fn agent_disable(&self) -> Result<()>
Disables agent check.
sourcepub fn agent_force_up(&self) -> Result<()>
pub fn agent_force_up(&self) -> Result<()>
Forces agent check up.
sourcepub fn agent_force_down(&self) -> Result<()>
pub fn agent_force_down(&self) -> Result<()>
Forces agent check down.
Trait Implementations§
Auto Trait Implementations§
impl<'lua> Freeze for Server<'lua>
impl<'lua> !RefUnwindSafe for Server<'lua>
impl<'lua> !Send for Server<'lua>
impl<'lua> !Sync for Server<'lua>
impl<'lua> Unpin for Server<'lua>
impl<'lua> !UnwindSafe for Server<'lua>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)