Struct blockade::BlockadeHandler
[−]
[src]
pub struct BlockadeHandler { pub client: Client, pub host: String, pub blockades: Vec<String>, pub state: HashMap<String, BlockadeState>, pub config: HashMap<String, BlockadeConfig>, }
Fields
client: Client
host: String
blockades: Vec<String>
state: HashMap<String, BlockadeState>
config: HashMap<String, BlockadeConfig>
Methods
impl BlockadeHandler
[src]
pub fn new(host: &str) -> Self
[src]
Make a new BlockadeHandler that uses a blockade instance started at "host".
pub fn get_all_containers(
&mut self,
name: &str
) -> Result<Vec<String>, BlockadeError>
[src]
&mut self,
name: &str
) -> Result<Vec<String>, BlockadeError>
pub fn choose_random_container(
&mut self,
name: &str
) -> Result<String, BlockadeError>
[src]
&mut self,
name: &str
) -> Result<String, BlockadeError>
pub fn start_blockade(
&mut self,
name: &str,
config: BlockadeConfig,
restart: bool
) -> Result<(), BlockadeError>
[src]
&mut self,
name: &str,
config: BlockadeConfig,
restart: bool
) -> Result<(), BlockadeError>
Start a blockade from a given name and config struct.
pub fn start_container(
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
[src]
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
pub fn stop_container(
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
[src]
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
Stop a container by blockade name and container name.
pub fn restart_container(
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
[src]
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
Restart a container by blockade name and container name.
pub fn restart_one(&mut self, name: &str) -> Result<String, BlockadeError>
[src]
Restart a random-ish container. Returns the name of the restarted container.
pub fn kill_container(
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
[src]
&mut self,
name: &str,
container: &str
) -> Result<(), BlockadeError>
Kills a container by blockade name and container name.
pub fn kill_one(&mut self, name: &str) -> Result<String, BlockadeError>
[src]
Kill a random-ish container. Returns the name of the killed container.
pub fn make_partitions(
&mut self,
name: &str,
partitions: Vec<Vec<String>>
) -> Result<(), BlockadeError>
[src]
&mut self,
name: &str,
partitions: Vec<Vec<String>>
) -> Result<(), BlockadeError>
Makes partitions according to the given nested Vec<Vec
pub fn heal_partitions(&mut self, name: &str) -> Result<(), BlockadeError>
[src]
Puts all containers in one partition and restores the network QoS.
pub fn make_net_unreliable(&mut self, name: &str) -> Result<(), BlockadeError>
[src]
Makes the network condition generally bad. Introduces at least latency and dropped packets potentially also causes reordering of some magnitude.
pub fn make_net_fast(&mut self, name: &str) -> Result<(), BlockadeError>
[src]
Makes the network condition as good as can be given the host conditions. Generally this means near perfect since the containers are usually on the local machine and the OS is reasonably good about pushing packets.
pub fn destroy_blockade(&mut self, name: &str) -> Result<(), BlockadeError>
[src]
Shuts down the blockade and all of its containers. Probably don't want to use this blockade afterward, considering it's pretty final.