manta_shared/types/wire/node.rs
1//! Wire types for `POST /api/v1/nodes` (register a new HSM
2//! component).
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}