manta_shared/types/api/cluster.rs
1//! Parameters for `GET /clusters`.
2
3/// Typed parameters for fetching cluster node details.
4pub struct GetClusterParams {
5 /// Cluster group name to query; falls back to
6 /// `settings_group_name` when absent.
7 pub group_name: Option<String>,
8 /// Operator default from `cli.toml`'s `hsm_group`.
9 pub settings_group_name: Option<String>,
10 /// Optional power-status filter (e.g. `OFF`, `ON`, `READY`,
11 /// `STANDBY`, `PENDING`, `FAILED`, `CONFIGURED`); returns all nodes
12 /// when absent.
13 pub status_filter: Option<String>,
14}
15
16impl GetClusterParams {
17 /// Returns the effective group name, preferring the explicit
18 /// positional argument and falling back to the operator default from
19 /// `cli.toml`.
20 pub fn effective_group(&self) -> Option<&str> {
21 self
22 .group_name
23 .as_deref()
24 .or(self.settings_group_name.as_deref())
25 }
26}