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 enum class TargetConfigurationLockLevel{ 93 Invalid, 94 Baseline, 95 }; 96 97 enum class ConfigLockOptions{ 98 Invalid, 99 Unlocked, 100 Locked, 101 LockdownUnsupported, 102 CommandUnsupported, 103 }; 104 105 NLOHMANN_JSON_SERIALIZE_ENUM(MediaType, { 106 {MediaType::Invalid, "Invalid"}, 107 {MediaType::HDD, "HDD"}, 108 {MediaType::SSD, "SSD"}, 109 {MediaType::SMR, "SMR"}, 110 }); 111 112 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareType, { 113 {HotspareType::Invalid, "Invalid"}, 114 {HotspareType::None, "None"}, 115 {HotspareType::Global, "Global"}, 116 {HotspareType::Chassis, "Chassis"}, 117 {HotspareType::Dedicated, "Dedicated"}, 118 }); 119 120 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionAbility, { 121 {EncryptionAbility::Invalid, "Invalid"}, 122 {EncryptionAbility::None, "None"}, 123 {EncryptionAbility::SelfEncryptingDrive, "SelfEncryptingDrive"}, 124 {EncryptionAbility::Other, "Other"}, 125 }); 126 127 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionStatus, { 128 {EncryptionStatus::Invalid, "Invalid"}, 129 {EncryptionStatus::Unecrypted, "Unecrypted"}, 130 {EncryptionStatus::Unlocked, "Unlocked"}, 131 {EncryptionStatus::Locked, "Locked"}, 132 {EncryptionStatus::Foreign, "Foreign"}, 133 {EncryptionStatus::Unencrypted, "Unencrypted"}, 134 }); 135 136 NLOHMANN_JSON_SERIALIZE_ENUM(StatusIndicator, { 137 {StatusIndicator::Invalid, "Invalid"}, 138 {StatusIndicator::OK, "OK"}, 139 {StatusIndicator::Fail, "Fail"}, 140 {StatusIndicator::Rebuild, "Rebuild"}, 141 {StatusIndicator::PredictiveFailureAnalysis, "PredictiveFailureAnalysis"}, 142 {StatusIndicator::Hotspare, "Hotspare"}, 143 {StatusIndicator::InACriticalArray, "InACriticalArray"}, 144 {StatusIndicator::InAFailedArray, "InAFailedArray"}, 145 }); 146 147 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareReplacementModeType, { 148 {HotspareReplacementModeType::Invalid, "Invalid"}, 149 {HotspareReplacementModeType::Revertible, "Revertible"}, 150 {HotspareReplacementModeType::NonRevertible, "NonRevertible"}, 151 }); 152 153 NLOHMANN_JSON_SERIALIZE_ENUM(DataSanitizationType, { 154 {DataSanitizationType::Invalid, "Invalid"}, 155 {DataSanitizationType::BlockErase, "BlockErase"}, 156 {DataSanitizationType::CryptographicErase, "CryptographicErase"}, 157 {DataSanitizationType::Overwrite, "Overwrite"}, 158 }); 159 160 NLOHMANN_JSON_SERIALIZE_ENUM(FormFactor, { 161 {FormFactor::Invalid, "Invalid"}, 162 {FormFactor::Drive3_5, "Drive3_5"}, 163 {FormFactor::Drive2_5, "Drive2_5"}, 164 {FormFactor::EDSFF, "EDSFF"}, 165 {FormFactor::EDSFF_1U_Long, "EDSFF_1U_Long"}, 166 {FormFactor::EDSFF_1U_Short, "EDSFF_1U_Short"}, 167 {FormFactor::EDSFF_E3_Short, "EDSFF_E3_Short"}, 168 {FormFactor::EDSFF_E3_Long, "EDSFF_E3_Long"}, 169 {FormFactor::M2, "M2"}, 170 {FormFactor::M2_2230, "M2_2230"}, 171 {FormFactor::M2_2242, "M2_2242"}, 172 {FormFactor::M2_2260, "M2_2260"}, 173 {FormFactor::M2_2280, "M2_2280"}, 174 {FormFactor::M2_22110, "M2_22110"}, 175 {FormFactor::U2, "U2"}, 176 {FormFactor::PCIeSlotFullLength, "PCIeSlotFullLength"}, 177 {FormFactor::PCIeSlotLowProfile, "PCIeSlotLowProfile"}, 178 {FormFactor::PCIeHalfLength, "PCIeHalfLength"}, 179 {FormFactor::OEM, "OEM"}, 180 }); 181 182 NLOHMANN_JSON_SERIALIZE_ENUM(ConfigurationLock, { 183 {ConfigurationLock::Invalid, "Invalid"}, 184 {ConfigurationLock::Enabled, "Enabled"}, 185 {ConfigurationLock::Disabled, "Disabled"}, 186 {ConfigurationLock::Partial, "Partial"}, 187 }); 188 189 NLOHMANN_JSON_SERIALIZE_ENUM(TargetConfigurationLockLevel, { 190 {TargetConfigurationLockLevel::Invalid, "Invalid"}, 191 {TargetConfigurationLockLevel::Baseline, "Baseline"}, 192 }); 193 194 NLOHMANN_JSON_SERIALIZE_ENUM(ConfigLockOptions, { 195 {ConfigLockOptions::Invalid, "Invalid"}, 196 {ConfigLockOptions::Unlocked, "Unlocked"}, 197 {ConfigLockOptions::Locked, "Locked"}, 198 {ConfigLockOptions::LockdownUnsupported, "LockdownUnsupported"}, 199 {ConfigLockOptions::CommandUnsupported, "CommandUnsupported"}, 200 }); 201 202 } 203 // clang-format on 204