manta_shared/types/wire/power.rs
1//! Wire types for `POST /api/v1/power` (start a PCS power transition).
2
3use serde::{Deserialize, Serialize};
4use utoipa::ToSchema;
5
6pub use crate::types::params::power::{PowerAction, PowerTargetType};
7
8/// Request body for `POST /api/v1/power`.
9#[derive(Debug, Serialize, Deserialize, ToSchema)]
10pub struct PowerRequest {
11 /// Power operation to perform.
12 pub action: PowerAction,
13 /// For `Nodes`: hosts expression (xnames, NIDs, or hostlist
14 /// notation). For `Cluster`: the HSM group name.
15 pub host_expression: String,
16 /// Whether `host_expression` is a node expression or a cluster
17 /// name.
18 pub target_type: PowerTargetType,
19 /// Pass `--force` to the underlying power operation (forceful
20 /// shutdown/reset).
21 #[serde(default)]
22 pub force: bool,
23}