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     EfficiencyFavorPower,
175     EfficiencyFavorPerformance,
176 };
177 
178 enum class CompositionUseCase{
179     Invalid,
180     ResourceBlockCapable,
181     ExpandableSystem,
182 };
183 
184 enum class KMIPCachePolicy{
185     Invalid,
186     None,
187     AfterFirstUse,
188 };
189 
190 enum class DecommissionType{
191     Invalid,
192     All,
193     UserData,
194     ManagerConfig,
195     BIOSConfig,
196     NetworkConfig,
197     StorageConfig,
198     Logs,
199 };
200 
201 enum class LastResetCauses{
202     Invalid,
203     PowerButtonPress,
204     ManagementCommand,
205     PowerRestorePolicy,
206     RTCWakeup,
207     WatchdogExpiration,
208     OSSoftRestart,
209     SystemCrash,
210     ThermalEvent,
211     PowerEvent,
212     Unknown,
213 };
214 
215 NLOHMANN_JSON_SERIALIZE_ENUM(BootSource, {
216     {BootSource::Invalid, "Invalid"},
217     {BootSource::None, "None"},
218     {BootSource::Pxe, "Pxe"},
219     {BootSource::Floppy, "Floppy"},
220     {BootSource::Cd, "Cd"},
221     {BootSource::Usb, "Usb"},
222     {BootSource::Hdd, "Hdd"},
223     {BootSource::BiosSetup, "BiosSetup"},
224     {BootSource::Utilities, "Utilities"},
225     {BootSource::Diags, "Diags"},
226     {BootSource::UefiShell, "UefiShell"},
227     {BootSource::UefiTarget, "UefiTarget"},
228     {BootSource::SDCard, "SDCard"},
229     {BootSource::UefiHttp, "UefiHttp"},
230     {BootSource::RemoteDrive, "RemoteDrive"},
231     {BootSource::UefiBootNext, "UefiBootNext"},
232     {BootSource::Recovery, "Recovery"},
233 });
234 
235 NLOHMANN_JSON_SERIALIZE_ENUM(SystemType, {
236     {SystemType::Invalid, "Invalid"},
237     {SystemType::Physical, "Physical"},
238     {SystemType::Virtual, "Virtual"},
239     {SystemType::OS, "OS"},
240     {SystemType::PhysicallyPartitioned, "PhysicallyPartitioned"},
241     {SystemType::VirtuallyPartitioned, "VirtuallyPartitioned"},
242     {SystemType::Composed, "Composed"},
243     {SystemType::DPU, "DPU"},
244 });
245 
246 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, {
247     {IndicatorLED::Invalid, "Invalid"},
248     {IndicatorLED::Unknown, "Unknown"},
249     {IndicatorLED::Lit, "Lit"},
250     {IndicatorLED::Blinking, "Blinking"},
251     {IndicatorLED::Off, "Off"},
252 });
253 
254 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideEnabled, {
255     {BootSourceOverrideEnabled::Invalid, "Invalid"},
256     {BootSourceOverrideEnabled::Disabled, "Disabled"},
257     {BootSourceOverrideEnabled::Once, "Once"},
258     {BootSourceOverrideEnabled::Continuous, "Continuous"},
259 });
260 
261 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMirroring, {
262     {MemoryMirroring::Invalid, "Invalid"},
263     {MemoryMirroring::System, "System"},
264     {MemoryMirroring::DIMM, "DIMM"},
265     {MemoryMirroring::Hybrid, "Hybrid"},
266     {MemoryMirroring::None, "None"},
267 });
268 
269 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideMode, {
270     {BootSourceOverrideMode::Invalid, "Invalid"},
271     {BootSourceOverrideMode::Legacy, "Legacy"},
272     {BootSourceOverrideMode::UEFI, "UEFI"},
273 });
274 
275 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceType, {
276     {InterfaceType::Invalid, "Invalid"},
277     {InterfaceType::TPM1_2, "TPM1_2"},
278     {InterfaceType::TPM2_0, "TPM2_0"},
279     {InterfaceType::TCM1_0, "TCM1_0"},
280 });
281 
282 NLOHMANN_JSON_SERIALIZE_ENUM(HostingRole, {
283     {HostingRole::Invalid, "Invalid"},
284     {HostingRole::ApplicationServer, "ApplicationServer"},
285     {HostingRole::StorageServer, "StorageServer"},
286     {HostingRole::Switch, "Switch"},
287     {HostingRole::Appliance, "Appliance"},
288     {HostingRole::BareMetalServer, "BareMetalServer"},
289     {HostingRole::VirtualMachineServer, "VirtualMachineServer"},
290     {HostingRole::ContainerServer, "ContainerServer"},
291 });
292 
293 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceTypeSelection, {
294     {InterfaceTypeSelection::Invalid, "Invalid"},
295     {InterfaceTypeSelection::None, "None"},
296     {InterfaceTypeSelection::FirmwareUpdate, "FirmwareUpdate"},
297     {InterfaceTypeSelection::BiosSetting, "BiosSetting"},
298     {InterfaceTypeSelection::OemMethod, "OemMethod"},
299 });
300 
301 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogWarningActions, {
302     {WatchdogWarningActions::Invalid, "Invalid"},
303     {WatchdogWarningActions::None, "None"},
304     {WatchdogWarningActions::DiagnosticInterrupt, "DiagnosticInterrupt"},
305     {WatchdogWarningActions::SMI, "SMI"},
306     {WatchdogWarningActions::MessagingInterrupt, "MessagingInterrupt"},
307     {WatchdogWarningActions::SCI, "SCI"},
308     {WatchdogWarningActions::OEM, "OEM"},
309 });
310 
311 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogTimeoutActions, {
312     {WatchdogTimeoutActions::Invalid, "Invalid"},
313     {WatchdogTimeoutActions::None, "None"},
314     {WatchdogTimeoutActions::ResetSystem, "ResetSystem"},
315     {WatchdogTimeoutActions::PowerCycle, "PowerCycle"},
316     {WatchdogTimeoutActions::PowerDown, "PowerDown"},
317     {WatchdogTimeoutActions::OEM, "OEM"},
318 });
319 
320 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, {
321     {PowerRestorePolicyTypes::Invalid, "Invalid"},
322     {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"},
323     {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"},
324     {PowerRestorePolicyTypes::LastState, "LastState"},
325 });
326 
327 NLOHMANN_JSON_SERIALIZE_ENUM(BootOrderTypes, {
328     {BootOrderTypes::Invalid, "Invalid"},
329     {BootOrderTypes::BootOrder, "BootOrder"},
330     {BootOrderTypes::AliasBootOrder, "AliasBootOrder"},
331 });
332 
333 NLOHMANN_JSON_SERIALIZE_ENUM(AutomaticRetryConfig, {
334     {AutomaticRetryConfig::Invalid, "Invalid"},
335     {AutomaticRetryConfig::Disabled, "Disabled"},
336     {AutomaticRetryConfig::RetryAttempts, "RetryAttempts"},
337     {AutomaticRetryConfig::RetryAlways, "RetryAlways"},
338 });
339 
340 NLOHMANN_JSON_SERIALIZE_ENUM(BootProgressTypes, {
341     {BootProgressTypes::Invalid, "Invalid"},
342     {BootProgressTypes::None, "None"},
343     {BootProgressTypes::PrimaryProcessorInitializationStarted, "PrimaryProcessorInitializationStarted"},
344     {BootProgressTypes::BusInitializationStarted, "BusInitializationStarted"},
345     {BootProgressTypes::MemoryInitializationStarted, "MemoryInitializationStarted"},
346     {BootProgressTypes::SecondaryProcessorInitializationStarted, "SecondaryProcessorInitializationStarted"},
347     {BootProgressTypes::PCIResourceConfigStarted, "PCIResourceConfigStarted"},
348     {BootProgressTypes::SystemHardwareInitializationComplete, "SystemHardwareInitializationComplete"},
349     {BootProgressTypes::SetupEntered, "SetupEntered"},
350     {BootProgressTypes::OSBootStarted, "OSBootStarted"},
351     {BootProgressTypes::OSRunning, "OSRunning"},
352     {BootProgressTypes::OEM, "OEM"},
353 });
354 
355 NLOHMANN_JSON_SERIALIZE_ENUM(GraphicalConnectTypesSupported, {
356     {GraphicalConnectTypesSupported::Invalid, "Invalid"},
357     {GraphicalConnectTypesSupported::KVMIP, "KVMIP"},
358     {GraphicalConnectTypesSupported::OEM, "OEM"},
359 });
360 
361 NLOHMANN_JSON_SERIALIZE_ENUM(TrustedModuleRequiredToBoot, {
362     {TrustedModuleRequiredToBoot::Invalid, "Invalid"},
363     {TrustedModuleRequiredToBoot::Disabled, "Disabled"},
364     {TrustedModuleRequiredToBoot::Required, "Required"},
365 });
366 
367 NLOHMANN_JSON_SERIALIZE_ENUM(StopBootOnFault, {
368     {StopBootOnFault::Invalid, "Invalid"},
369     {StopBootOnFault::Never, "Never"},
370     {StopBootOnFault::AnyFault, "AnyFault"},
371 });
372 
373 NLOHMANN_JSON_SERIALIZE_ENUM(PowerMode, {
374     {PowerMode::Invalid, "Invalid"},
375     {PowerMode::MaximumPerformance, "MaximumPerformance"},
376     {PowerMode::BalancedPerformance, "BalancedPerformance"},
377     {PowerMode::PowerSaving, "PowerSaving"},
378     {PowerMode::Static, "Static"},
379     {PowerMode::OSControlled, "OSControlled"},
380     {PowerMode::OEM, "OEM"},
381     {PowerMode::EfficiencyFavorPower, "EfficiencyFavorPower"},
382     {PowerMode::EfficiencyFavorPerformance, "EfficiencyFavorPerformance"},
383 });
384 
385 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionUseCase, {
386     {CompositionUseCase::Invalid, "Invalid"},
387     {CompositionUseCase::ResourceBlockCapable, "ResourceBlockCapable"},
388     {CompositionUseCase::ExpandableSystem, "ExpandableSystem"},
389 });
390 
391 NLOHMANN_JSON_SERIALIZE_ENUM(KMIPCachePolicy, {
392     {KMIPCachePolicy::Invalid, "Invalid"},
393     {KMIPCachePolicy::None, "None"},
394     {KMIPCachePolicy::AfterFirstUse, "AfterFirstUse"},
395 });
396 
397 NLOHMANN_JSON_SERIALIZE_ENUM(DecommissionType, {
398     {DecommissionType::Invalid, "Invalid"},
399     {DecommissionType::All, "All"},
400     {DecommissionType::UserData, "UserData"},
401     {DecommissionType::ManagerConfig, "ManagerConfig"},
402     {DecommissionType::BIOSConfig, "BIOSConfig"},
403     {DecommissionType::NetworkConfig, "NetworkConfig"},
404     {DecommissionType::StorageConfig, "StorageConfig"},
405     {DecommissionType::Logs, "Logs"},
406 });
407 
408 NLOHMANN_JSON_SERIALIZE_ENUM(LastResetCauses, {
409     {LastResetCauses::Invalid, "Invalid"},
410     {LastResetCauses::PowerButtonPress, "PowerButtonPress"},
411     {LastResetCauses::ManagementCommand, "ManagementCommand"},
412     {LastResetCauses::PowerRestorePolicy, "PowerRestorePolicy"},
413     {LastResetCauses::RTCWakeup, "RTCWakeup"},
414     {LastResetCauses::WatchdogExpiration, "WatchdogExpiration"},
415     {LastResetCauses::OSSoftRestart, "OSSoftRestart"},
416     {LastResetCauses::SystemCrash, "SystemCrash"},
417     {LastResetCauses::ThermalEvent, "ThermalEvent"},
418     {LastResetCauses::PowerEvent, "PowerEvent"},
419     {LastResetCauses::Unknown, "Unknown"},
420 });
421 
422 }
423 // clang-format on
424