1853c0dc5SEd Tanous #pragma once 2853c0dc5SEd Tanous #include <nlohmann/json.hpp> 3853c0dc5SEd Tanous 4853c0dc5SEd Tanous namespace volume 5853c0dc5SEd Tanous { 6853c0dc5SEd Tanous // clang-format off 7853c0dc5SEd Tanous 8853c0dc5SEd Tanous enum class InitializeType{ 9853c0dc5SEd Tanous Invalid, 10853c0dc5SEd Tanous Fast, 11853c0dc5SEd Tanous Slow, 12853c0dc5SEd Tanous }; 13853c0dc5SEd Tanous 14853c0dc5SEd Tanous enum class InitializeMethod{ 15853c0dc5SEd Tanous Invalid, 16853c0dc5SEd Tanous Skip, 17853c0dc5SEd Tanous Background, 18853c0dc5SEd Tanous Foreground, 19853c0dc5SEd Tanous }; 20853c0dc5SEd Tanous 21853c0dc5SEd Tanous enum class RAIDType{ 22853c0dc5SEd Tanous Invalid, 23853c0dc5SEd Tanous RAID0, 24853c0dc5SEd Tanous RAID1, 25853c0dc5SEd Tanous RAID3, 26853c0dc5SEd Tanous RAID4, 27853c0dc5SEd Tanous RAID5, 28853c0dc5SEd Tanous RAID6, 29853c0dc5SEd Tanous RAID10, 30853c0dc5SEd Tanous RAID01, 31853c0dc5SEd Tanous RAID6TP, 32853c0dc5SEd Tanous RAID1E, 33853c0dc5SEd Tanous RAID50, 34853c0dc5SEd Tanous RAID60, 35853c0dc5SEd Tanous RAID00, 36853c0dc5SEd Tanous RAID10E, 37853c0dc5SEd Tanous RAID1Triple, 38853c0dc5SEd Tanous RAID10Triple, 39853c0dc5SEd Tanous None, 40853c0dc5SEd Tanous }; 41853c0dc5SEd Tanous 42853c0dc5SEd Tanous enum class VolumeType{ 43853c0dc5SEd Tanous Invalid, 44853c0dc5SEd Tanous RawDevice, 45853c0dc5SEd Tanous NonRedundant, 46853c0dc5SEd Tanous Mirrored, 47853c0dc5SEd Tanous StripedWithParity, 48853c0dc5SEd Tanous SpannedMirrors, 49853c0dc5SEd Tanous SpannedStripesWithParity, 50853c0dc5SEd Tanous }; 51853c0dc5SEd Tanous 52853c0dc5SEd Tanous enum class EncryptionTypes{ 53853c0dc5SEd Tanous Invalid, 54853c0dc5SEd Tanous NativeDriveEncryption, 55853c0dc5SEd Tanous ControllerAssisted, 56853c0dc5SEd Tanous SoftwareAssisted, 57853c0dc5SEd Tanous }; 58853c0dc5SEd Tanous 59853c0dc5SEd Tanous enum class WriteHoleProtectionPolicyType{ 60853c0dc5SEd Tanous Invalid, 61853c0dc5SEd Tanous Off, 62853c0dc5SEd Tanous Journaling, 63853c0dc5SEd Tanous DistributedLog, 64853c0dc5SEd Tanous Oem, 65853c0dc5SEd Tanous }; 66853c0dc5SEd Tanous 67853c0dc5SEd Tanous enum class VolumeUsageType{ 68853c0dc5SEd Tanous Invalid, 69853c0dc5SEd Tanous Data, 70853c0dc5SEd Tanous SystemData, 71853c0dc5SEd Tanous CacheOnly, 72853c0dc5SEd Tanous SystemReserve, 73853c0dc5SEd Tanous ReplicationReserve, 74853c0dc5SEd Tanous }; 75853c0dc5SEd Tanous 76853c0dc5SEd Tanous enum class ReadCachePolicyType{ 77853c0dc5SEd Tanous Invalid, 78853c0dc5SEd Tanous ReadAhead, 79853c0dc5SEd Tanous AdaptiveReadAhead, 80853c0dc5SEd Tanous Off, 81853c0dc5SEd Tanous }; 82853c0dc5SEd Tanous 83853c0dc5SEd Tanous enum class WriteCachePolicyType{ 84853c0dc5SEd Tanous Invalid, 85853c0dc5SEd Tanous WriteThrough, 86853c0dc5SEd Tanous ProtectedWriteBack, 87853c0dc5SEd Tanous UnprotectedWriteBack, 88853c0dc5SEd Tanous Off, 89853c0dc5SEd Tanous }; 90853c0dc5SEd Tanous 91853c0dc5SEd Tanous enum class WriteCacheStateType{ 92853c0dc5SEd Tanous Invalid, 93853c0dc5SEd Tanous Unprotected, 94853c0dc5SEd Tanous Protected, 95853c0dc5SEd Tanous Degraded, 96853c0dc5SEd Tanous }; 97853c0dc5SEd Tanous 98853c0dc5SEd Tanous enum class LBAFormatType{ 99853c0dc5SEd Tanous Invalid, 100853c0dc5SEd Tanous LBAFormat0, 101853c0dc5SEd Tanous LBAFormat1, 102853c0dc5SEd Tanous LBAFormat2, 103853c0dc5SEd Tanous LBAFormat3, 104853c0dc5SEd Tanous LBAFormat4, 105853c0dc5SEd Tanous LBAFormat5, 106853c0dc5SEd Tanous LBAFormat6, 107853c0dc5SEd Tanous LBAFormat7, 108853c0dc5SEd Tanous LBAFormat8, 109853c0dc5SEd Tanous LBAFormat9, 110853c0dc5SEd Tanous LBAFormat10, 111853c0dc5SEd Tanous LBAFormat11, 112853c0dc5SEd Tanous LBAFormat12, 113853c0dc5SEd Tanous LBAFormat13, 114853c0dc5SEd Tanous LBAFormat14, 115853c0dc5SEd Tanous LBAFormat15, 116853c0dc5SEd Tanous }; 117853c0dc5SEd Tanous 118*f263e09cSEd Tanous enum class NamespaceType{ 119*f263e09cSEd Tanous Invalid, 120*f263e09cSEd Tanous Block, 121*f263e09cSEd Tanous KeyValue, 122*f263e09cSEd Tanous ZNS, 123*f263e09cSEd Tanous Computational, 124*f263e09cSEd Tanous }; 125*f263e09cSEd Tanous 126*f263e09cSEd Tanous enum class OperationType{ 127*f263e09cSEd Tanous Invalid, 128*f263e09cSEd Tanous Deduplicate, 129*f263e09cSEd Tanous CheckConsistency, 130*f263e09cSEd Tanous Initialize, 131*f263e09cSEd Tanous Replicate, 132*f263e09cSEd Tanous Delete, 133*f263e09cSEd Tanous ChangeRAIDType, 134*f263e09cSEd Tanous Rebuild, 135*f263e09cSEd Tanous Encrypt, 136*f263e09cSEd Tanous Decrypt, 137*f263e09cSEd Tanous Resize, 138*f263e09cSEd Tanous Compress, 139*f263e09cSEd Tanous Sanitize, 140*f263e09cSEd Tanous Format, 141*f263e09cSEd Tanous }; 142*f263e09cSEd Tanous 143*f263e09cSEd Tanous enum class LBARelativePerformanceType{ 144*f263e09cSEd Tanous Invalid, 145*f263e09cSEd Tanous Best, 146*f263e09cSEd Tanous Better, 147*f263e09cSEd Tanous Good, 148*f263e09cSEd Tanous Degraded, 149*f263e09cSEd Tanous }; 150*f263e09cSEd Tanous 151853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(InitializeType, { 152853c0dc5SEd Tanous {InitializeType::Invalid, "Invalid"}, 153853c0dc5SEd Tanous {InitializeType::Fast, "Fast"}, 154853c0dc5SEd Tanous {InitializeType::Slow, "Slow"}, 155853c0dc5SEd Tanous }); 156853c0dc5SEd Tanous 157853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(InitializeMethod, { 158853c0dc5SEd Tanous {InitializeMethod::Invalid, "Invalid"}, 159853c0dc5SEd Tanous {InitializeMethod::Skip, "Skip"}, 160853c0dc5SEd Tanous {InitializeMethod::Background, "Background"}, 161853c0dc5SEd Tanous {InitializeMethod::Foreground, "Foreground"}, 162853c0dc5SEd Tanous }); 163853c0dc5SEd Tanous 164853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(RAIDType, { 165853c0dc5SEd Tanous {RAIDType::Invalid, "Invalid"}, 166853c0dc5SEd Tanous {RAIDType::RAID0, "RAID0"}, 167853c0dc5SEd Tanous {RAIDType::RAID1, "RAID1"}, 168853c0dc5SEd Tanous {RAIDType::RAID3, "RAID3"}, 169853c0dc5SEd Tanous {RAIDType::RAID4, "RAID4"}, 170853c0dc5SEd Tanous {RAIDType::RAID5, "RAID5"}, 171853c0dc5SEd Tanous {RAIDType::RAID6, "RAID6"}, 172853c0dc5SEd Tanous {RAIDType::RAID10, "RAID10"}, 173853c0dc5SEd Tanous {RAIDType::RAID01, "RAID01"}, 174853c0dc5SEd Tanous {RAIDType::RAID6TP, "RAID6TP"}, 175853c0dc5SEd Tanous {RAIDType::RAID1E, "RAID1E"}, 176853c0dc5SEd Tanous {RAIDType::RAID50, "RAID50"}, 177853c0dc5SEd Tanous {RAIDType::RAID60, "RAID60"}, 178853c0dc5SEd Tanous {RAIDType::RAID00, "RAID00"}, 179853c0dc5SEd Tanous {RAIDType::RAID10E, "RAID10E"}, 180853c0dc5SEd Tanous {RAIDType::RAID1Triple, "RAID1Triple"}, 181853c0dc5SEd Tanous {RAIDType::RAID10Triple, "RAID10Triple"}, 182853c0dc5SEd Tanous {RAIDType::None, "None"}, 183853c0dc5SEd Tanous }); 184853c0dc5SEd Tanous 185853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(VolumeType, { 186853c0dc5SEd Tanous {VolumeType::Invalid, "Invalid"}, 187853c0dc5SEd Tanous {VolumeType::RawDevice, "RawDevice"}, 188853c0dc5SEd Tanous {VolumeType::NonRedundant, "NonRedundant"}, 189853c0dc5SEd Tanous {VolumeType::Mirrored, "Mirrored"}, 190853c0dc5SEd Tanous {VolumeType::StripedWithParity, "StripedWithParity"}, 191853c0dc5SEd Tanous {VolumeType::SpannedMirrors, "SpannedMirrors"}, 192853c0dc5SEd Tanous {VolumeType::SpannedStripesWithParity, "SpannedStripesWithParity"}, 193853c0dc5SEd Tanous }); 194853c0dc5SEd Tanous 195853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionTypes, { 196853c0dc5SEd Tanous {EncryptionTypes::Invalid, "Invalid"}, 197853c0dc5SEd Tanous {EncryptionTypes::NativeDriveEncryption, "NativeDriveEncryption"}, 198853c0dc5SEd Tanous {EncryptionTypes::ControllerAssisted, "ControllerAssisted"}, 199853c0dc5SEd Tanous {EncryptionTypes::SoftwareAssisted, "SoftwareAssisted"}, 200853c0dc5SEd Tanous }); 201853c0dc5SEd Tanous 202853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(WriteHoleProtectionPolicyType, { 203853c0dc5SEd Tanous {WriteHoleProtectionPolicyType::Invalid, "Invalid"}, 204853c0dc5SEd Tanous {WriteHoleProtectionPolicyType::Off, "Off"}, 205853c0dc5SEd Tanous {WriteHoleProtectionPolicyType::Journaling, "Journaling"}, 206853c0dc5SEd Tanous {WriteHoleProtectionPolicyType::DistributedLog, "DistributedLog"}, 207853c0dc5SEd Tanous {WriteHoleProtectionPolicyType::Oem, "Oem"}, 208853c0dc5SEd Tanous }); 209853c0dc5SEd Tanous 210853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(VolumeUsageType, { 211853c0dc5SEd Tanous {VolumeUsageType::Invalid, "Invalid"}, 212853c0dc5SEd Tanous {VolumeUsageType::Data, "Data"}, 213853c0dc5SEd Tanous {VolumeUsageType::SystemData, "SystemData"}, 214853c0dc5SEd Tanous {VolumeUsageType::CacheOnly, "CacheOnly"}, 215853c0dc5SEd Tanous {VolumeUsageType::SystemReserve, "SystemReserve"}, 216853c0dc5SEd Tanous {VolumeUsageType::ReplicationReserve, "ReplicationReserve"}, 217853c0dc5SEd Tanous }); 218853c0dc5SEd Tanous 219853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(ReadCachePolicyType, { 220853c0dc5SEd Tanous {ReadCachePolicyType::Invalid, "Invalid"}, 221853c0dc5SEd Tanous {ReadCachePolicyType::ReadAhead, "ReadAhead"}, 222853c0dc5SEd Tanous {ReadCachePolicyType::AdaptiveReadAhead, "AdaptiveReadAhead"}, 223853c0dc5SEd Tanous {ReadCachePolicyType::Off, "Off"}, 224853c0dc5SEd Tanous }); 225853c0dc5SEd Tanous 226853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(WriteCachePolicyType, { 227853c0dc5SEd Tanous {WriteCachePolicyType::Invalid, "Invalid"}, 228853c0dc5SEd Tanous {WriteCachePolicyType::WriteThrough, "WriteThrough"}, 229853c0dc5SEd Tanous {WriteCachePolicyType::ProtectedWriteBack, "ProtectedWriteBack"}, 230853c0dc5SEd Tanous {WriteCachePolicyType::UnprotectedWriteBack, "UnprotectedWriteBack"}, 231853c0dc5SEd Tanous {WriteCachePolicyType::Off, "Off"}, 232853c0dc5SEd Tanous }); 233853c0dc5SEd Tanous 234853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(WriteCacheStateType, { 235853c0dc5SEd Tanous {WriteCacheStateType::Invalid, "Invalid"}, 236853c0dc5SEd Tanous {WriteCacheStateType::Unprotected, "Unprotected"}, 237853c0dc5SEd Tanous {WriteCacheStateType::Protected, "Protected"}, 238853c0dc5SEd Tanous {WriteCacheStateType::Degraded, "Degraded"}, 239853c0dc5SEd Tanous }); 240853c0dc5SEd Tanous 241853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LBAFormatType, { 242853c0dc5SEd Tanous {LBAFormatType::Invalid, "Invalid"}, 243853c0dc5SEd Tanous {LBAFormatType::LBAFormat0, "LBAFormat0"}, 244853c0dc5SEd Tanous {LBAFormatType::LBAFormat1, "LBAFormat1"}, 245853c0dc5SEd Tanous {LBAFormatType::LBAFormat2, "LBAFormat2"}, 246853c0dc5SEd Tanous {LBAFormatType::LBAFormat3, "LBAFormat3"}, 247853c0dc5SEd Tanous {LBAFormatType::LBAFormat4, "LBAFormat4"}, 248853c0dc5SEd Tanous {LBAFormatType::LBAFormat5, "LBAFormat5"}, 249853c0dc5SEd Tanous {LBAFormatType::LBAFormat6, "LBAFormat6"}, 250853c0dc5SEd Tanous {LBAFormatType::LBAFormat7, "LBAFormat7"}, 251853c0dc5SEd Tanous {LBAFormatType::LBAFormat8, "LBAFormat8"}, 252853c0dc5SEd Tanous {LBAFormatType::LBAFormat9, "LBAFormat9"}, 253853c0dc5SEd Tanous {LBAFormatType::LBAFormat10, "LBAFormat10"}, 254853c0dc5SEd Tanous {LBAFormatType::LBAFormat11, "LBAFormat11"}, 255853c0dc5SEd Tanous {LBAFormatType::LBAFormat12, "LBAFormat12"}, 256853c0dc5SEd Tanous {LBAFormatType::LBAFormat13, "LBAFormat13"}, 257853c0dc5SEd Tanous {LBAFormatType::LBAFormat14, "LBAFormat14"}, 258853c0dc5SEd Tanous {LBAFormatType::LBAFormat15, "LBAFormat15"}, 259853c0dc5SEd Tanous }); 260853c0dc5SEd Tanous 261*f263e09cSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(NamespaceType, { 262*f263e09cSEd Tanous {NamespaceType::Invalid, "Invalid"}, 263*f263e09cSEd Tanous {NamespaceType::Block, "Block"}, 264*f263e09cSEd Tanous {NamespaceType::KeyValue, "KeyValue"}, 265*f263e09cSEd Tanous {NamespaceType::ZNS, "ZNS"}, 266*f263e09cSEd Tanous {NamespaceType::Computational, "Computational"}, 267*f263e09cSEd Tanous }); 268*f263e09cSEd Tanous 269*f263e09cSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(OperationType, { 270*f263e09cSEd Tanous {OperationType::Invalid, "Invalid"}, 271*f263e09cSEd Tanous {OperationType::Deduplicate, "Deduplicate"}, 272*f263e09cSEd Tanous {OperationType::CheckConsistency, "CheckConsistency"}, 273*f263e09cSEd Tanous {OperationType::Initialize, "Initialize"}, 274*f263e09cSEd Tanous {OperationType::Replicate, "Replicate"}, 275*f263e09cSEd Tanous {OperationType::Delete, "Delete"}, 276*f263e09cSEd Tanous {OperationType::ChangeRAIDType, "ChangeRAIDType"}, 277*f263e09cSEd Tanous {OperationType::Rebuild, "Rebuild"}, 278*f263e09cSEd Tanous {OperationType::Encrypt, "Encrypt"}, 279*f263e09cSEd Tanous {OperationType::Decrypt, "Decrypt"}, 280*f263e09cSEd Tanous {OperationType::Resize, "Resize"}, 281*f263e09cSEd Tanous {OperationType::Compress, "Compress"}, 282*f263e09cSEd Tanous {OperationType::Sanitize, "Sanitize"}, 283*f263e09cSEd Tanous {OperationType::Format, "Format"}, 284*f263e09cSEd Tanous }); 285*f263e09cSEd Tanous 286*f263e09cSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LBARelativePerformanceType, { 287*f263e09cSEd Tanous {LBARelativePerformanceType::Invalid, "Invalid"}, 288*f263e09cSEd Tanous {LBARelativePerformanceType::Best, "Best"}, 289*f263e09cSEd Tanous {LBARelativePerformanceType::Better, "Better"}, 290*f263e09cSEd Tanous {LBARelativePerformanceType::Good, "Good"}, 291*f263e09cSEd Tanous {LBARelativePerformanceType::Degraded, "Degraded"}, 292*f263e09cSEd Tanous }); 293*f263e09cSEd Tanous 294853c0dc5SEd Tanous } 295853c0dc5SEd Tanous // clang-format on 296