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