Skip to main content

manta_shared/shared/params/
power.rs

1//! Parameters for `POST /power`.
2
3/// The power operation to apply to a list of xnames.
4#[derive(Debug, Clone, Copy)]
5pub enum PowerAction {
6  /// Power on (cold start) the listed xnames.
7  On,
8  /// Power off the listed xnames; graceful unless `force` is set.
9  Off,
10  /// Power-cycle (reset) the listed xnames; graceful unless `force`
11  /// is set.
12  Reset,
13}
14
15/// Typed parameters for the power-action service call.
16pub struct ApplyPowerParams {
17  /// Power operation to perform on every entry in `xnames`.
18  pub action: PowerAction,
19  /// Resolved list of xnames (already expanded from any HSM-group
20  /// or hostlist expression by the caller).
21  pub xnames: Vec<String>,
22  /// When true, perform a hard power off / reset without the
23  /// graceful shutdown path.
24  pub force: bool,
25}