|
| 1 | +use std::fmt; |
| 2 | + |
| 3 | +use serde::{Deserialize, Serialize}; |
| 4 | + |
| 5 | +/// This OEM specific extension is mainly applicable for querying chassis information for the ERoT subsystem |
| 6 | +/// odata_type is always present regardless of the subsystem we are querying for (Bluefield_BMC, Bluefield_ERoT, or Card1) |
| 7 | +/// the remaining attributes are only present when querying the Bluefield_ERoT |
| 8 | +/// Due to the indistinguishable names, this is used for DPUs, GB200, and potentially others; comments describe |
| 9 | +/// what platforms it may be expected on. |
| 10 | +#[derive(Debug, Serialize, Deserialize, Clone)] |
| 11 | +#[serde(rename_all = "PascalCase")] |
| 12 | +pub struct ChassisExtensions { |
| 13 | + #[serde(rename = "@odata.type")] |
| 14 | + pub odata_type: String, |
| 15 | + pub automatic_background_copy_enabled: Option<bool>, // DPU |
| 16 | + pub background_copy_status: Option<BackgroundCopyStatus>, // DPU |
| 17 | + pub inband_update_policy_enabled: Option<bool>, // DPU |
| 18 | + pub chassis_physical_slot_number: Option<i32>, // GB200 |
| 19 | + pub compute_tray_index: Option<i32>, // GB200 |
| 20 | + pub topology_id: Option<i32>, // GB200 |
| 21 | + pub revision_id: Option<i32>, // GB200 |
| 22 | +} |
| 23 | + |
| 24 | +#[derive(Debug, Serialize, Deserialize, Copy, Clone, Eq, PartialEq)] |
| 25 | +pub enum BackgroundCopyStatus { |
| 26 | + InProgress, |
| 27 | + Completed, |
| 28 | + Pending, |
| 29 | +} |
| 30 | + |
| 31 | +impl fmt::Display for BackgroundCopyStatus { |
| 32 | + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 33 | + fmt::Debug::fmt(self, f) |
| 34 | + } |
| 35 | +} |
0 commit comments