1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace computer_system 5 { 6 // clang-format off 7 8 enum class BootSource{ 9 Invalid, 10 None, 11 Pxe, 12 Floppy, 13 Cd, 14 Usb, 15 Hdd, 16 BiosSetup, 17 Utilities, 18 Diags, 19 UefiShell, 20 UefiTarget, 21 SDCard, 22 UefiHttp, 23 RemoteDrive, 24 UefiBootNext, 25 Recovery, 26 }; 27 28 enum class SystemType{ 29 Invalid, 30 Physical, 31 Virtual, 32 OS, 33 PhysicallyPartitioned, 34 VirtuallyPartitioned, 35 Composed, 36 DPU, 37 }; 38 39 enum class IndicatorLED{ 40 Invalid, 41 Unknown, 42 Lit, 43 Blinking, 44 Off, 45 }; 46 47 enum class BootSourceOverrideEnabled{ 48 Invalid, 49 Disabled, 50 Once, 51 Continuous, 52 }; 53 54 enum class MemoryMirroring{ 55 Invalid, 56 System, 57 DIMM, 58 Hybrid, 59 None, 60 }; 61 62 enum class BootSourceOverrideMode{ 63 Invalid, 64 Legacy, 65 UEFI, 66 }; 67 68 enum class InterfaceType{ 69 Invalid, 70 TPM1_2, 71 TPM2_0, 72 TCM1_0, 73 }; 74 75 enum class HostingRole{ 76 Invalid, 77 ApplicationServer, 78 StorageServer, 79 Switch, 80 Appliance, 81 BareMetalServer, 82 VirtualMachineServer, 83 ContainerServer, 84 }; 85 86 enum class InterfaceTypeSelection{ 87 Invalid, 88 None, 89 FirmwareUpdate, 90 BiosSetting, 91 OemMethod, 92 }; 93 94 enum class WatchdogWarningActions{ 95 Invalid, 96 None, 97 DiagnosticInterrupt, 98 SMI, 99 MessagingInterrupt, 100 SCI, 101 OEM, 102 }; 103 104 enum class WatchdogTimeoutActions{ 105 Invalid, 106 None, 107 ResetSystem, 108 PowerCycle, 109 PowerDown, 110 OEM, 111 }; 112 113 enum class PowerRestorePolicyTypes{ 114 Invalid, 115 AlwaysOn, 116 AlwaysOff, 117 LastState, 118 }; 119 120 enum class BootOrderTypes{ 121 Invalid, 122 BootOrder, 123 AliasBootOrder, 124 }; 125 126 enum class AutomaticRetryConfig{ 127 Invalid, 128 Disabled, 129 RetryAttempts, 130 RetryAlways, 131 }; 132 133 enum class BootProgressTypes{ 134 Invalid, 135 None, 136 PrimaryProcessorInitializationStarted, 137 BusInitializationStarted, 138 MemoryInitializationStarted, 139 SecondaryProcessorInitializationStarted, 140 PCIResourceConfigStarted, 141 SystemHardwareInitializationComplete, 142 SetupEntered, 143 OSBootStarted, 144 OSRunning, 145 OEM, 146 }; 147 148 enum class GraphicalConnectTypesSupported{ 149 Invalid, 150 KVMIP, 151 OEM, 152 }; 153 154 enum class TrustedModuleRequiredToBoot{ 155 Invalid, 156 Disabled, 157 Required, 158 }; 159 160 enum class StopBootOnFault{ 161 Invalid, 162 Never, 163 AnyFault, 164 }; 165 166 enum class PowerMode{ 167 Invalid, 168 MaximumPerformance, 169 BalancedPerformance, 170 PowerSaving, 171 Static, 172 OSControlled, 173 OEM, 174 }; 175 176 enum class CompositionUseCase{ 177 Invalid, 178 ResourceBlockCapable, 179 ExpandableSystem, 180 }; 181 182 enum class KMIPCachePolicy{ 183 Invalid, 184 None, 185 AfterFirstUse, 186 }; 187 188 enum class DecommissionType{ 189 Invalid, 190 All, 191 UserData, 192 ManagerConfig, 193 BIOSConfig, 194 NetworkConfig, 195 StorageConfig, 196 Logs, 197 }; 198 199 NLOHMANN_JSON_SERIALIZE_ENUM(BootSource, { 200 {BootSource::Invalid, "Invalid"}, 201 {BootSource::None, "None"}, 202 {BootSource::Pxe, "Pxe"}, 203 {BootSource::Floppy, "Floppy"}, 204 {BootSource::Cd, "Cd"}, 205 {BootSource::Usb, "Usb"}, 206 {BootSource::Hdd, "Hdd"}, 207 {BootSource::BiosSetup, "BiosSetup"}, 208 {BootSource::Utilities, "Utilities"}, 209 {BootSource::Diags, "Diags"}, 210 {BootSource::UefiShell, "UefiShell"}, 211 {BootSource::UefiTarget, "UefiTarget"}, 212 {BootSource::SDCard, "SDCard"}, 213 {BootSource::UefiHttp, "UefiHttp"}, 214 {BootSource::RemoteDrive, "RemoteDrive"}, 215 {BootSource::UefiBootNext, "UefiBootNext"}, 216 {BootSource::Recovery, "Recovery"}, 217 }); 218 219 NLOHMANN_JSON_SERIALIZE_ENUM(SystemType, { 220 {SystemType::Invalid, "Invalid"}, 221 {SystemType::Physical, "Physical"}, 222 {SystemType::Virtual, "Virtual"}, 223 {SystemType::OS, "OS"}, 224 {SystemType::PhysicallyPartitioned, "PhysicallyPartitioned"}, 225 {SystemType::VirtuallyPartitioned, "VirtuallyPartitioned"}, 226 {SystemType::Composed, "Composed"}, 227 {SystemType::DPU, "DPU"}, 228 }); 229 230 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, { 231 {IndicatorLED::Invalid, "Invalid"}, 232 {IndicatorLED::Unknown, "Unknown"}, 233 {IndicatorLED::Lit, "Lit"}, 234 {IndicatorLED::Blinking, "Blinking"}, 235 {IndicatorLED::Off, "Off"}, 236 }); 237 238 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideEnabled, { 239 {BootSourceOverrideEnabled::Invalid, "Invalid"}, 240 {BootSourceOverrideEnabled::Disabled, "Disabled"}, 241 {BootSourceOverrideEnabled::Once, "Once"}, 242 {BootSourceOverrideEnabled::Continuous, "Continuous"}, 243 }); 244 245 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMirroring, { 246 {MemoryMirroring::Invalid, "Invalid"}, 247 {MemoryMirroring::System, "System"}, 248 {MemoryMirroring::DIMM, "DIMM"}, 249 {MemoryMirroring::Hybrid, "Hybrid"}, 250 {MemoryMirroring::None, "None"}, 251 }); 252 253 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideMode, { 254 {BootSourceOverrideMode::Invalid, "Invalid"}, 255 {BootSourceOverrideMode::Legacy, "Legacy"}, 256 {BootSourceOverrideMode::UEFI, "UEFI"}, 257 }); 258 259 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceType, { 260 {InterfaceType::Invalid, "Invalid"}, 261 {InterfaceType::TPM1_2, "TPM1_2"}, 262 {InterfaceType::TPM2_0, "TPM2_0"}, 263 {InterfaceType::TCM1_0, "TCM1_0"}, 264 }); 265 266 NLOHMANN_JSON_SERIALIZE_ENUM(HostingRole, { 267 {HostingRole::Invalid, "Invalid"}, 268 {HostingRole::ApplicationServer, "ApplicationServer"}, 269 {HostingRole::StorageServer, "StorageServer"}, 270 {HostingRole::Switch, "Switch"}, 271 {HostingRole::Appliance, "Appliance"}, 272 {HostingRole::BareMetalServer, "BareMetalServer"}, 273 {HostingRole::VirtualMachineServer, "VirtualMachineServer"}, 274 {HostingRole::ContainerServer, "ContainerServer"}, 275 }); 276 277 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceTypeSelection, { 278 {InterfaceTypeSelection::Invalid, "Invalid"}, 279 {InterfaceTypeSelection::None, "None"}, 280 {InterfaceTypeSelection::FirmwareUpdate, "FirmwareUpdate"}, 281 {InterfaceTypeSelection::BiosSetting, "BiosSetting"}, 282 {InterfaceTypeSelection::OemMethod, "OemMethod"}, 283 }); 284 285 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogWarningActions, { 286 {WatchdogWarningActions::Invalid, "Invalid"}, 287 {WatchdogWarningActions::None, "None"}, 288 {WatchdogWarningActions::DiagnosticInterrupt, "DiagnosticInterrupt"}, 289 {WatchdogWarningActions::SMI, "SMI"}, 290 {WatchdogWarningActions::MessagingInterrupt, "MessagingInterrupt"}, 291 {WatchdogWarningActions::SCI, "SCI"}, 292 {WatchdogWarningActions::OEM, "OEM"}, 293 }); 294 295 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogTimeoutActions, { 296 {WatchdogTimeoutActions::Invalid, "Invalid"}, 297 {WatchdogTimeoutActions::None, "None"}, 298 {WatchdogTimeoutActions::ResetSystem, "ResetSystem"}, 299 {WatchdogTimeoutActions::PowerCycle, "PowerCycle"}, 300 {WatchdogTimeoutActions::PowerDown, "PowerDown"}, 301 {WatchdogTimeoutActions::OEM, "OEM"}, 302 }); 303 304 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, { 305 {PowerRestorePolicyTypes::Invalid, "Invalid"}, 306 {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"}, 307 {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"}, 308 {PowerRestorePolicyTypes::LastState, "LastState"}, 309 }); 310 311 NLOHMANN_JSON_SERIALIZE_ENUM(BootOrderTypes, { 312 {BootOrderTypes::Invalid, "Invalid"}, 313 {BootOrderTypes::BootOrder, "BootOrder"}, 314 {BootOrderTypes::AliasBootOrder, "AliasBootOrder"}, 315 }); 316 317 NLOHMANN_JSON_SERIALIZE_ENUM(AutomaticRetryConfig, { 318 {AutomaticRetryConfig::Invalid, "Invalid"}, 319 {AutomaticRetryConfig::Disabled, "Disabled"}, 320 {AutomaticRetryConfig::RetryAttempts, "RetryAttempts"}, 321 {AutomaticRetryConfig::RetryAlways, "RetryAlways"}, 322 }); 323 324 NLOHMANN_JSON_SERIALIZE_ENUM(BootProgressTypes, { 325 {BootProgressTypes::Invalid, "Invalid"}, 326 {BootProgressTypes::None, "None"}, 327 {BootProgressTypes::PrimaryProcessorInitializationStarted, "PrimaryProcessorInitializationStarted"}, 328 {BootProgressTypes::BusInitializationStarted, "BusInitializationStarted"}, 329 {BootProgressTypes::MemoryInitializationStarted, "MemoryInitializationStarted"}, 330 {BootProgressTypes::SecondaryProcessorInitializationStarted, "SecondaryProcessorInitializationStarted"}, 331 {BootProgressTypes::PCIResourceConfigStarted, "PCIResourceConfigStarted"}, 332 {BootProgressTypes::SystemHardwareInitializationComplete, "SystemHardwareInitializationComplete"}, 333 {BootProgressTypes::SetupEntered, "SetupEntered"}, 334 {BootProgressTypes::OSBootStarted, "OSBootStarted"}, 335 {BootProgressTypes::OSRunning, "OSRunning"}, 336 {BootProgressTypes::OEM, "OEM"}, 337 }); 338 339 NLOHMANN_JSON_SERIALIZE_ENUM(GraphicalConnectTypesSupported, { 340 {GraphicalConnectTypesSupported::Invalid, "Invalid"}, 341 {GraphicalConnectTypesSupported::KVMIP, "KVMIP"}, 342 {GraphicalConnectTypesSupported::OEM, "OEM"}, 343 }); 344 345 NLOHMANN_JSON_SERIALIZE_ENUM(TrustedModuleRequiredToBoot, { 346 {TrustedModuleRequiredToBoot::Invalid, "Invalid"}, 347 {TrustedModuleRequiredToBoot::Disabled, "Disabled"}, 348 {TrustedModuleRequiredToBoot::Required, "Required"}, 349 }); 350 351 NLOHMANN_JSON_SERIALIZE_ENUM(StopBootOnFault, { 352 {StopBootOnFault::Invalid, "Invalid"}, 353 {StopBootOnFault::Never, "Never"}, 354 {StopBootOnFault::AnyFault, "AnyFault"}, 355 }); 356 357 NLOHMANN_JSON_SERIALIZE_ENUM(PowerMode, { 358 {PowerMode::Invalid, "Invalid"}, 359 {PowerMode::MaximumPerformance, "MaximumPerformance"}, 360 {PowerMode::BalancedPerformance, "BalancedPerformance"}, 361 {PowerMode::PowerSaving, "PowerSaving"}, 362 {PowerMode::Static, "Static"}, 363 {PowerMode::OSControlled, "OSControlled"}, 364 {PowerMode::OEM, "OEM"}, 365 }); 366 367 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionUseCase, { 368 {CompositionUseCase::Invalid, "Invalid"}, 369 {CompositionUseCase::ResourceBlockCapable, "ResourceBlockCapable"}, 370 {CompositionUseCase::ExpandableSystem, "ExpandableSystem"}, 371 }); 372 373 NLOHMANN_JSON_SERIALIZE_ENUM(KMIPCachePolicy, { 374 {KMIPCachePolicy::Invalid, "Invalid"}, 375 {KMIPCachePolicy::None, "None"}, 376 {KMIPCachePolicy::AfterFirstUse, "AfterFirstUse"}, 377 }); 378 379 NLOHMANN_JSON_SERIALIZE_ENUM(DecommissionType, { 380 {DecommissionType::Invalid, "Invalid"}, 381 {DecommissionType::All, "All"}, 382 {DecommissionType::UserData, "UserData"}, 383 {DecommissionType::ManagerConfig, "ManagerConfig"}, 384 {DecommissionType::BIOSConfig, "BIOSConfig"}, 385 {DecommissionType::NetworkConfig, "NetworkConfig"}, 386 {DecommissionType::StorageConfig, "StorageConfig"}, 387 {DecommissionType::Logs, "Logs"}, 388 }); 389 390 } 391 // clang-format on 392