manta_shared/types/api/
hardware.rs

1//! Parameters for `GET /groups/hardware` (and the deprecated
2//! `/hardware-clusters` alias) and `GET /hardware-nodes-list`.
3
4/// Typed parameters for fetching cluster hardware inventory.
5pub struct GetHardwareClusterParams {
6  /// Cluster group name to inventory; `None` falls back to the
7  /// operator default.
8  pub group_name: Option<String>,
9  /// Operator default from `cli.toml`'s `hsm_group`, used when
10  /// `group_name` is absent.
11  pub settings_hsm_group_name: Option<String>,
12}
13
14impl GetHardwareClusterParams {
15  /// Returns the effective group name, preferring the explicit
16  /// positional argument and falling back to the operator default
17  /// from `cli.toml`.
18  pub fn effective_group(&self) -> Option<&str> {
19    self
20      .group_name
21      .as_deref()
22      .or(self.settings_hsm_group_name.as_deref())
23  }
24}
25
26/// Typed parameters for fetching hardware inventory for a list of nodes.
27#[derive(Debug)]
28pub struct GetHardwareNodesListParams {
29  /// Hosts expression (xnames, NIDs, or hostlist notation).
30  pub host_expression: String,
31}