1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace physical_context 5 { 6 // clang-format off 7 8 enum class PhysicalContext{ 9 Invalid, 10 Room, 11 Intake, 12 Exhaust, 13 LiquidInlet, 14 LiquidOutlet, 15 Front, 16 Back, 17 Upper, 18 Lower, 19 CPU, 20 CPUSubsystem, 21 GPU, 22 GPUSubsystem, 23 FPGA, 24 Accelerator, 25 ASIC, 26 Backplane, 27 SystemBoard, 28 PowerSupply, 29 PowerSubsystem, 30 VoltageRegulator, 31 Rectifier, 32 StorageDevice, 33 StorageSubsystem, 34 NetworkingDevice, 35 ExpansionSubsystem, 36 ComputeBay, 37 StorageBay, 38 NetworkBay, 39 ExpansionBay, 40 PowerSupplyBay, 41 Memory, 42 MemorySubsystem, 43 Chassis, 44 Fan, 45 CoolingSubsystem, 46 Motor, 47 Transformer, 48 ACUtilityInput, 49 ACStaticBypassInput, 50 ACMaintenanceBypassInput, 51 DCBus, 52 ACOutput, 53 ACInput, 54 PowerOutlet, 55 TrustedModule, 56 Board, 57 Transceiver, 58 Battery, 59 Pump, 60 Filter, 61 Reservoir, 62 Switch, 63 Manager, 64 }; 65 66 enum class PhysicalSubContext{ 67 Invalid, 68 Input, 69 Output, 70 }; 71 72 enum class LogicalContext{ 73 Invalid, 74 Capacity, 75 Environment, 76 Network, 77 Performance, 78 Security, 79 Storage, 80 }; 81 82 NLOHMANN_JSON_SERIALIZE_ENUM(PhysicalContext, { 83 {PhysicalContext::Invalid, "Invalid"}, 84 {PhysicalContext::Room, "Room"}, 85 {PhysicalContext::Intake, "Intake"}, 86 {PhysicalContext::Exhaust, "Exhaust"}, 87 {PhysicalContext::LiquidInlet, "LiquidInlet"}, 88 {PhysicalContext::LiquidOutlet, "LiquidOutlet"}, 89 {PhysicalContext::Front, "Front"}, 90 {PhysicalContext::Back, "Back"}, 91 {PhysicalContext::Upper, "Upper"}, 92 {PhysicalContext::Lower, "Lower"}, 93 {PhysicalContext::CPU, "CPU"}, 94 {PhysicalContext::CPUSubsystem, "CPUSubsystem"}, 95 {PhysicalContext::GPU, "GPU"}, 96 {PhysicalContext::GPUSubsystem, "GPUSubsystem"}, 97 {PhysicalContext::FPGA, "FPGA"}, 98 {PhysicalContext::Accelerator, "Accelerator"}, 99 {PhysicalContext::ASIC, "ASIC"}, 100 {PhysicalContext::Backplane, "Backplane"}, 101 {PhysicalContext::SystemBoard, "SystemBoard"}, 102 {PhysicalContext::PowerSupply, "PowerSupply"}, 103 {PhysicalContext::PowerSubsystem, "PowerSubsystem"}, 104 {PhysicalContext::VoltageRegulator, "VoltageRegulator"}, 105 {PhysicalContext::Rectifier, "Rectifier"}, 106 {PhysicalContext::StorageDevice, "StorageDevice"}, 107 {PhysicalContext::StorageSubsystem, "StorageSubsystem"}, 108 {PhysicalContext::NetworkingDevice, "NetworkingDevice"}, 109 {PhysicalContext::ExpansionSubsystem, "ExpansionSubsystem"}, 110 {PhysicalContext::ComputeBay, "ComputeBay"}, 111 {PhysicalContext::StorageBay, "StorageBay"}, 112 {PhysicalContext::NetworkBay, "NetworkBay"}, 113 {PhysicalContext::ExpansionBay, "ExpansionBay"}, 114 {PhysicalContext::PowerSupplyBay, "PowerSupplyBay"}, 115 {PhysicalContext::Memory, "Memory"}, 116 {PhysicalContext::MemorySubsystem, "MemorySubsystem"}, 117 {PhysicalContext::Chassis, "Chassis"}, 118 {PhysicalContext::Fan, "Fan"}, 119 {PhysicalContext::CoolingSubsystem, "CoolingSubsystem"}, 120 {PhysicalContext::Motor, "Motor"}, 121 {PhysicalContext::Transformer, "Transformer"}, 122 {PhysicalContext::ACUtilityInput, "ACUtilityInput"}, 123 {PhysicalContext::ACStaticBypassInput, "ACStaticBypassInput"}, 124 {PhysicalContext::ACMaintenanceBypassInput, "ACMaintenanceBypassInput"}, 125 {PhysicalContext::DCBus, "DCBus"}, 126 {PhysicalContext::ACOutput, "ACOutput"}, 127 {PhysicalContext::ACInput, "ACInput"}, 128 {PhysicalContext::PowerOutlet, "PowerOutlet"}, 129 {PhysicalContext::TrustedModule, "TrustedModule"}, 130 {PhysicalContext::Board, "Board"}, 131 {PhysicalContext::Transceiver, "Transceiver"}, 132 {PhysicalContext::Battery, "Battery"}, 133 {PhysicalContext::Pump, "Pump"}, 134 {PhysicalContext::Filter, "Filter"}, 135 {PhysicalContext::Reservoir, "Reservoir"}, 136 {PhysicalContext::Switch, "Switch"}, 137 {PhysicalContext::Manager, "Manager"}, 138 }); 139 140 NLOHMANN_JSON_SERIALIZE_ENUM(PhysicalSubContext, { 141 {PhysicalSubContext::Invalid, "Invalid"}, 142 {PhysicalSubContext::Input, "Input"}, 143 {PhysicalSubContext::Output, "Output"}, 144 }); 145 146 NLOHMANN_JSON_SERIALIZE_ENUM(LogicalContext, { 147 {LogicalContext::Invalid, "Invalid"}, 148 {LogicalContext::Capacity, "Capacity"}, 149 {LogicalContext::Environment, "Environment"}, 150 {LogicalContext::Network, "Network"}, 151 {LogicalContext::Performance, "Performance"}, 152 {LogicalContext::Security, "Security"}, 153 {LogicalContext::Storage, "Storage"}, 154 }); 155 156 } 157 // clang-format on 158