Skip to main content

manta_shared/shared/
dto.rs

1//! Wire response types shared by both binaries.
2//!
3//! The CLI (in `http_client.rs` and `cli::output::*`) deserializes
4//! responses from the manta-server using these types; the server
5//! serializes them back over HTTP via the service layer.
6//!
7//! `NodeDetails` is mirrored locally (rather than re-exporting from
8//! `csm-rs`) so `manta-shared` — and therefore `manta-cli` — does not
9//! transitively depend on `csm-rs`. The server converts from
10//! `csm_rs::node::types::NodeDetails` at the service-layer boundary
11//! (see `crates/manta-server/src/wire_conv.rs`). The JSON wire shape
12//! is byte-identical: same field names, no `#[serde(rename)]`.
13//!
14//! The remaining re-exports come from the lightweight
15//! `manta-backend-dispatcher` crate (types + traits only, no csm-rs
16//! / ochami-rs deps). Mirroring those too is a separate, optional
17//! follow-up.
18
19pub use manta_backend_dispatcher::types::{
20  Group, NodeSummary,
21  bos::session_template::BosSessionTemplate,
22  bss::BootParameters,
23  cfs::{
24    cfs_configuration_response::CfsConfigurationResponse,
25    session::CfsSessionGetResponse,
26  },
27  ims::Image,
28};
29
30use serde::{Deserialize, Serialize};
31
32/// Per-node details returned by `GET /api/v1/nodes`.
33///
34/// Mirror of `csm_rs::node::types::NodeDetails` with identical fields
35/// and identical JSON wire format. The server converts from the
36/// upstream type via `From` in `wire_conv.rs`.
37#[derive(Debug, Serialize, Deserialize)]
38pub struct NodeDetails {
39  pub xname: String,
40  pub nid: String,
41  pub hsm: String,
42  pub power_status: String,
43  pub desired_configuration: String,
44  pub configuration_status: String,
45  pub enabled: String,
46  pub error_count: String,
47  pub boot_image_id: String,
48  pub boot_configuration: String,
49  pub kernel_params: String,
50}