manta_shared/types/api/node.rs
1//! HTTP request/response bodies and CLI-built parameter structs for
2//! the node endpoints (`/api/v1/nodes`).
3
4use serde::{Deserialize, Serialize};
5use utoipa::ToSchema;
6
7/// Request body for `POST /api/v1/nodes`.
8#[derive(Debug, Serialize, Deserialize, ToSchema)]
9pub struct AddNodeRequest {
10 /// Physical location ID (xname) of the node, e.g. `x3000c0s1b0n0`.
11 pub id: String,
12 /// Initial HSM group the node belongs to.
13 pub group: String,
14 /// Whether to register the node as enabled. Defaults to `false`
15 /// (disabled) per serde's default for `bool`; the CLI's
16 /// `manta add node` flips the polarity via `--disabled`.
17 #[serde(default)]
18 pub enabled: bool,
19 /// Optional architecture tag: `"X86"`, `"ARM"`, or `"Other"`.
20 pub arch: Option<String>,
21}
22
23/// Typed parameters for fetching node details.
24pub struct GetNodesParams {
25 /// Comma-separated xnames, NIDs, or hostlist expression
26 /// (e.g. `x3000c0s1b0n[0-3]`).
27 pub host_expression: String,
28 /// When true, also return nodes sharing a power supply with any
29 /// requested node.
30 pub include_siblings: bool,
31 /// Optional power-status filter (e.g. `ON`, `OFF`, `READY`).
32 pub status_filter: Option<String>,
33}