1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace drive 5 { 6 // clang-format off 7 8 enum class MediaType{ 9 Invalid, 10 HDD, 11 SSD, 12 SMR, 13 }; 14 15 enum class HotspareType{ 16 Invalid, 17 None, 18 Global, 19 Chassis, 20 Dedicated, 21 }; 22 23 enum class EncryptionAbility{ 24 Invalid, 25 None, 26 SelfEncryptingDrive, 27 Other, 28 }; 29 30 enum class EncryptionStatus{ 31 Invalid, 32 Unecrypted, 33 Unlocked, 34 Locked, 35 Foreign, 36 Unencrypted, 37 }; 38 39 enum class StatusIndicator{ 40 Invalid, 41 OK, 42 Fail, 43 Rebuild, 44 PredictiveFailureAnalysis, 45 Hotspare, 46 InACriticalArray, 47 InAFailedArray, 48 }; 49 50 enum class HotspareReplacementModeType{ 51 Invalid, 52 Revertible, 53 NonRevertible, 54 }; 55 56 enum class DataSanitizationType{ 57 Invalid, 58 BlockErase, 59 CryptographicErase, 60 Overwrite, 61 }; 62 63 enum class FormFactor{ 64 Invalid, 65 Drive3_5, 66 Drive2_5, 67 EDSFF, 68 EDSFF_1U_Long, 69 EDSFF_1U_Short, 70 EDSFF_E3_Short, 71 EDSFF_E3_Long, 72 M2, 73 M2_2230, 74 M2_2242, 75 M2_2260, 76 M2_2280, 77 M2_22110, 78 U2, 79 PCIeSlotFullLength, 80 PCIeSlotLowProfile, 81 PCIeHalfLength, 82 OEM, 83 }; 84 85 enum class ConfigurationLock{ 86 Invalid, 87 Enabled, 88 Disabled, 89 Partial, 90 }; 91 92 NLOHMANN_JSON_SERIALIZE_ENUM(MediaType, { 93 {MediaType::Invalid, "Invalid"}, 94 {MediaType::HDD, "HDD"}, 95 {MediaType::SSD, "SSD"}, 96 {MediaType::SMR, "SMR"}, 97 }); 98 99 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareType, { 100 {HotspareType::Invalid, "Invalid"}, 101 {HotspareType::None, "None"}, 102 {HotspareType::Global, "Global"}, 103 {HotspareType::Chassis, "Chassis"}, 104 {HotspareType::Dedicated, "Dedicated"}, 105 }); 106 107 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionAbility, { 108 {EncryptionAbility::Invalid, "Invalid"}, 109 {EncryptionAbility::None, "None"}, 110 {EncryptionAbility::SelfEncryptingDrive, "SelfEncryptingDrive"}, 111 {EncryptionAbility::Other, "Other"}, 112 }); 113 114 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionStatus, { 115 {EncryptionStatus::Invalid, "Invalid"}, 116 {EncryptionStatus::Unecrypted, "Unecrypted"}, 117 {EncryptionStatus::Unlocked, "Unlocked"}, 118 {EncryptionStatus::Locked, "Locked"}, 119 {EncryptionStatus::Foreign, "Foreign"}, 120 {EncryptionStatus::Unencrypted, "Unencrypted"}, 121 }); 122 123 NLOHMANN_JSON_SERIALIZE_ENUM(StatusIndicator, { 124 {StatusIndicator::Invalid, "Invalid"}, 125 {StatusIndicator::OK, "OK"}, 126 {StatusIndicator::Fail, "Fail"}, 127 {StatusIndicator::Rebuild, "Rebuild"}, 128 {StatusIndicator::PredictiveFailureAnalysis, "PredictiveFailureAnalysis"}, 129 {StatusIndicator::Hotspare, "Hotspare"}, 130 {StatusIndicator::InACriticalArray, "InACriticalArray"}, 131 {StatusIndicator::InAFailedArray, "InAFailedArray"}, 132 }); 133 134 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareReplacementModeType, { 135 {HotspareReplacementModeType::Invalid, "Invalid"}, 136 {HotspareReplacementModeType::Revertible, "Revertible"}, 137 {HotspareReplacementModeType::NonRevertible, "NonRevertible"}, 138 }); 139 140 NLOHMANN_JSON_SERIALIZE_ENUM(DataSanitizationType, { 141 {DataSanitizationType::Invalid, "Invalid"}, 142 {DataSanitizationType::BlockErase, "BlockErase"}, 143 {DataSanitizationType::CryptographicErase, "CryptographicErase"}, 144 {DataSanitizationType::Overwrite, "Overwrite"}, 145 }); 146 147 NLOHMANN_JSON_SERIALIZE_ENUM(FormFactor, { 148 {FormFactor::Invalid, "Invalid"}, 149 {FormFactor::Drive3_5, "Drive3_5"}, 150 {FormFactor::Drive2_5, "Drive2_5"}, 151 {FormFactor::EDSFF, "EDSFF"}, 152 {FormFactor::EDSFF_1U_Long, "EDSFF_1U_Long"}, 153 {FormFactor::EDSFF_1U_Short, "EDSFF_1U_Short"}, 154 {FormFactor::EDSFF_E3_Short, "EDSFF_E3_Short"}, 155 {FormFactor::EDSFF_E3_Long, "EDSFF_E3_Long"}, 156 {FormFactor::M2, "M2"}, 157 {FormFactor::M2_2230, "M2_2230"}, 158 {FormFactor::M2_2242, "M2_2242"}, 159 {FormFactor::M2_2260, "M2_2260"}, 160 {FormFactor::M2_2280, "M2_2280"}, 161 {FormFactor::M2_22110, "M2_22110"}, 162 {FormFactor::U2, "U2"}, 163 {FormFactor::PCIeSlotFullLength, "PCIeSlotFullLength"}, 164 {FormFactor::PCIeSlotLowProfile, "PCIeSlotLowProfile"}, 165 {FormFactor::PCIeHalfLength, "PCIeHalfLength"}, 166 {FormFactor::OEM, "OEM"}, 167 }); 168 169 NLOHMANN_JSON_SERIALIZE_ENUM(ConfigurationLock, { 170 {ConfigurationLock::Invalid, "Invalid"}, 171 {ConfigurationLock::Enabled, "Enabled"}, 172 {ConfigurationLock::Disabled, "Disabled"}, 173 {ConfigurationLock::Partial, "Partial"}, 174 }); 175 176 } 177 // clang-format on 178