rufish 0.4.0

An asynchronous Redfish client library for BMC/server management in Rust.
Documentation
//! Hardware topology data for UI visualization.

use serde::{Deserialize, Serialize};

use crate::enriched::HealthStatus;

/// Complete hardware topology of a system for UI rendering.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HardwareTopology {
    pub system: SystemNode,
    pub chassis: Vec<ChassisNode>,
    pub managers: Vec<ManagerNode>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SystemNode {
    pub id: String,
    pub name: Option<String>,
    pub model: Option<String>,
    pub manufacturer: Option<String>,
    pub serial_number: Option<String>,
    pub power_state: Option<String>,
    pub status: HealthStatus,
    pub processors: Vec<ComponentNode>,
    pub memory: Vec<ComponentNode>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChassisNode {
    pub id: String,
    pub name: Option<String>,
    pub chassis_type: Option<String>,
    pub model: Option<String>,
    pub serial_number: Option<String>,
    pub status: HealthStatus,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ManagerNode {
    pub id: String,
    pub name: Option<String>,
    pub manager_type: Option<String>,
    pub firmware_version: Option<String>,
    pub status: HealthStatus,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ComponentNode {
    pub id: String,
    pub name: Option<String>,
    pub description: Option<String>,
    pub status: HealthStatus,
}