1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace resource_block 5 { 6 // clang-format off 7 8 enum class ResourceBlockType{ 9 Invalid, 10 Compute, 11 Processor, 12 Memory, 13 Network, 14 Storage, 15 ComputerSystem, 16 Expansion, 17 IndependentResource, 18 }; 19 20 enum class CompositionState{ 21 Invalid, 22 Composing, 23 ComposedAndAvailable, 24 Composed, 25 Unused, 26 Failed, 27 Unavailable, 28 }; 29 30 enum class PoolType{ 31 Invalid, 32 Free, 33 Active, 34 Unassigned, 35 }; 36 37 NLOHMANN_JSON_SERIALIZE_ENUM(ResourceBlockType, { 38 {ResourceBlockType::Invalid, "Invalid"}, 39 {ResourceBlockType::Compute, "Compute"}, 40 {ResourceBlockType::Processor, "Processor"}, 41 {ResourceBlockType::Memory, "Memory"}, 42 {ResourceBlockType::Network, "Network"}, 43 {ResourceBlockType::Storage, "Storage"}, 44 {ResourceBlockType::ComputerSystem, "ComputerSystem"}, 45 {ResourceBlockType::Expansion, "Expansion"}, 46 {ResourceBlockType::IndependentResource, "IndependentResource"}, 47 }); 48 49 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionState, { 50 {CompositionState::Invalid, "Invalid"}, 51 {CompositionState::Composing, "Composing"}, 52 {CompositionState::ComposedAndAvailable, "ComposedAndAvailable"}, 53 {CompositionState::Composed, "Composed"}, 54 {CompositionState::Unused, "Unused"}, 55 {CompositionState::Failed, "Failed"}, 56 {CompositionState::Unavailable, "Unavailable"}, 57 }); 58 59 NLOHMANN_JSON_SERIALIZE_ENUM(PoolType, { 60 {PoolType::Invalid, "Invalid"}, 61 {PoolType::Free, "Free"}, 62 {PoolType::Active, "Active"}, 63 {PoolType::Unassigned, "Unassigned"}, 64 }); 65 66 } 67 // clang-format on 68