pub struct Lab<'r> { /* private fields */ }Expand description
A run: a manifest under a name, on a runner.
Implementations§
Source§impl Lab<'_>
impl Lab<'_>
Sourcepub async fn down(&self, opts: &RunOptions, events: &dyn Events) -> Result<()>
pub async fn down(&self, opts: &RunOptions, events: &dyn Events) -> Result<()>
Removes everything the run created (containers, networks, volumes).
§Errors
Fails, after its error event, when the run is recorded elsewhere, a down step fails, or
the run’s state can’t be locked or written.
Sourcepub async fn check(
&self,
opts: &RunOptions,
events: &dyn Events,
) -> Result<CheckReport>
pub async fn check( &self, opts: &RunOptions, events: &dyn Events, ) -> Result<CheckReport>
Runs the lab’s checks against the running run.
§Errors
Fails with not_running when no target machine runs, and when a setup or teardown step
fails. A failing check isn’t an error: the report says it (ok: false).
Sourcepub async fn provision(
&self,
machine: Option<&str>,
opts: &RunOptions,
events: &dyn Events,
) -> Result<()>
pub async fn provision( &self, machine: Option<&str>, opts: &RunOptions, events: &dyn Events, ) -> Result<()>
Runs the lab’s set-up again on its running machines, every one or machine (a lab machine
of the manifest), without rebuilding them: the manifest’s provision steps. The values
given at launch aren’t kept by the runner: pass them again in opts.
§Errors
Fails with machine_unknown for a machine the lab doesn’t have, not_running when no
target machine runs, unsupported when the manifest has no provision steps, and as
Lab::up does for a step or the state.
Source§impl Lab<'_>
impl Lab<'_>
Sourcepub async fn up(&self, opts: &RunOptions, events: &dyn Events) -> Result<Run>
pub async fn up(&self, opts: &RunOptions, events: &dyn Events) -> Result<Run>
Starts the run: refused while it runs or runs elsewhere; a parked run is resumed (with
Occupied::ResumeParked); leftovers are removed first.
§Errors
Fails, after its error event, when the run is up already (already_running) or recorded
elsewhere (running_elsewhere); when a param, secret or tool is missing or refused; when a
host port is taken (port_in_use); when a step fails or runs out of time (tool_failed,
tool_missing, timeout); when a ready condition doesn’t hold (not_ready); or when the
run’s state can’t be locked or written (locked, io).
Source§impl<'r> Lab<'r>
impl<'r> Lab<'r>
Sourcepub fn with_connection(self, secrets: Secrets) -> Lab<'r>
pub fn with_connection(self, secrets: Secrets) -> Lab<'r>
The lab with secrets, the values of its connection slots (an ESXi host’s password),
delivered to every operation: status and park, which take no options, too. Kept in memory
only, never stored; a value an operation’s options give wins.
Sourcepub async fn status(&self) -> Result<Status>
pub async fn status(&self) -> Result<Status>
The run as it stands: read-only, never locked, and never an event.
§Errors
Fails when the engine can’t be asked (the status step fails or runs out of time) or the run’s record can’t be read.