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 
118f263e09cSEd Tanous enum class NamespaceType{
119f263e09cSEd Tanous     Invalid,
120f263e09cSEd Tanous     Block,
121f263e09cSEd Tanous     KeyValue,
122f263e09cSEd Tanous     ZNS,
123f263e09cSEd Tanous     Computational,
124f263e09cSEd Tanous };
125f263e09cSEd Tanous 
126f263e09cSEd Tanous enum class OperationType{
127f263e09cSEd Tanous     Invalid,
128f263e09cSEd Tanous     Deduplicate,
129f263e09cSEd Tanous     CheckConsistency,
130f263e09cSEd Tanous     Initialize,
131f263e09cSEd Tanous     Replicate,
132f263e09cSEd Tanous     Delete,
133f263e09cSEd Tanous     ChangeRAIDType,
134f263e09cSEd Tanous     Rebuild,
135f263e09cSEd Tanous     Encrypt,
136f263e09cSEd Tanous     Decrypt,
137f263e09cSEd Tanous     Resize,
138f263e09cSEd Tanous     Compress,
139f263e09cSEd Tanous     Sanitize,
140f263e09cSEd Tanous     Format,
141*e9cc1bc9SEd Tanous     ChangeStripSize,
142f263e09cSEd Tanous };
143f263e09cSEd Tanous 
144f263e09cSEd Tanous enum class LBARelativePerformanceType{
145f263e09cSEd Tanous     Invalid,
146f263e09cSEd Tanous     Best,
147f263e09cSEd Tanous     Better,
148f263e09cSEd Tanous     Good,
149f263e09cSEd Tanous     Degraded,
150f263e09cSEd Tanous };
151f263e09cSEd Tanous 
152853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(InitializeType, {
153853c0dc5SEd Tanous     {InitializeType::Invalid, "Invalid"},
154853c0dc5SEd Tanous     {InitializeType::Fast, "Fast"},
155853c0dc5SEd Tanous     {InitializeType::Slow, "Slow"},
156853c0dc5SEd Tanous });
157853c0dc5SEd Tanous 
158853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(InitializeMethod, {
159853c0dc5SEd Tanous     {InitializeMethod::Invalid, "Invalid"},
160853c0dc5SEd Tanous     {InitializeMethod::Skip, "Skip"},
161853c0dc5SEd Tanous     {InitializeMethod::Background, "Background"},
162853c0dc5SEd Tanous     {InitializeMethod::Foreground, "Foreground"},
163853c0dc5SEd Tanous });
164853c0dc5SEd Tanous 
165853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(RAIDType, {
166853c0dc5SEd Tanous     {RAIDType::Invalid, "Invalid"},
167853c0dc5SEd Tanous     {RAIDType::RAID0, "RAID0"},
168853c0dc5SEd Tanous     {RAIDType::RAID1, "RAID1"},
169853c0dc5SEd Tanous     {RAIDType::RAID3, "RAID3"},
170853c0dc5SEd Tanous     {RAIDType::RAID4, "RAID4"},
171853c0dc5SEd Tanous     {RAIDType::RAID5, "RAID5"},
172853c0dc5SEd Tanous     {RAIDType::RAID6, "RAID6"},
173853c0dc5SEd Tanous     {RAIDType::RAID10, "RAID10"},
174853c0dc5SEd Tanous     {RAIDType::RAID01, "RAID01"},
175853c0dc5SEd Tanous     {RAIDType::RAID6TP, "RAID6TP"},
176853c0dc5SEd Tanous     {RAIDType::RAID1E, "RAID1E"},
177853c0dc5SEd Tanous     {RAIDType::RAID50, "RAID50"},
178853c0dc5SEd Tanous     {RAIDType::RAID60, "RAID60"},
179853c0dc5SEd Tanous     {RAIDType::RAID00, "RAID00"},
180853c0dc5SEd Tanous     {RAIDType::RAID10E, "RAID10E"},
181853c0dc5SEd Tanous     {RAIDType::RAID1Triple, "RAID1Triple"},
182853c0dc5SEd Tanous     {RAIDType::RAID10Triple, "RAID10Triple"},
183853c0dc5SEd Tanous     {RAIDType::None, "None"},
184853c0dc5SEd Tanous });
185853c0dc5SEd Tanous 
186853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(VolumeType, {
187853c0dc5SEd Tanous     {VolumeType::Invalid, "Invalid"},
188853c0dc5SEd Tanous     {VolumeType::RawDevice, "RawDevice"},
189853c0dc5SEd Tanous     {VolumeType::NonRedundant, "NonRedundant"},
190853c0dc5SEd Tanous     {VolumeType::Mirrored, "Mirrored"},
191853c0dc5SEd Tanous     {VolumeType::StripedWithParity, "StripedWithParity"},
192853c0dc5SEd Tanous     {VolumeType::SpannedMirrors, "SpannedMirrors"},
193853c0dc5SEd Tanous     {VolumeType::SpannedStripesWithParity, "SpannedStripesWithParity"},
194853c0dc5SEd Tanous });
195853c0dc5SEd Tanous 
196853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionTypes, {
197853c0dc5SEd Tanous     {EncryptionTypes::Invalid, "Invalid"},
198853c0dc5SEd Tanous     {EncryptionTypes::NativeDriveEncryption, "NativeDriveEncryption"},
199853c0dc5SEd Tanous     {EncryptionTypes::ControllerAssisted, "ControllerAssisted"},
200853c0dc5SEd Tanous     {EncryptionTypes::SoftwareAssisted, "SoftwareAssisted"},
201853c0dc5SEd Tanous });
202853c0dc5SEd Tanous 
203853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(WriteHoleProtectionPolicyType, {
204853c0dc5SEd Tanous     {WriteHoleProtectionPolicyType::Invalid, "Invalid"},
205853c0dc5SEd Tanous     {WriteHoleProtectionPolicyType::Off, "Off"},
206853c0dc5SEd Tanous     {WriteHoleProtectionPolicyType::Journaling, "Journaling"},
207853c0dc5SEd Tanous     {WriteHoleProtectionPolicyType::DistributedLog, "DistributedLog"},
208853c0dc5SEd Tanous     {WriteHoleProtectionPolicyType::Oem, "Oem"},
209853c0dc5SEd Tanous });
210853c0dc5SEd Tanous 
211853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(VolumeUsageType, {
212853c0dc5SEd Tanous     {VolumeUsageType::Invalid, "Invalid"},
213853c0dc5SEd Tanous     {VolumeUsageType::Data, "Data"},
214853c0dc5SEd Tanous     {VolumeUsageType::SystemData, "SystemData"},
215853c0dc5SEd Tanous     {VolumeUsageType::CacheOnly, "CacheOnly"},
216853c0dc5SEd Tanous     {VolumeUsageType::SystemReserve, "SystemReserve"},
217853c0dc5SEd Tanous     {VolumeUsageType::ReplicationReserve, "ReplicationReserve"},
218853c0dc5SEd Tanous });
219853c0dc5SEd Tanous 
220853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(ReadCachePolicyType, {
221853c0dc5SEd Tanous     {ReadCachePolicyType::Invalid, "Invalid"},
222853c0dc5SEd Tanous     {ReadCachePolicyType::ReadAhead, "ReadAhead"},
223853c0dc5SEd Tanous     {ReadCachePolicyType::AdaptiveReadAhead, "AdaptiveReadAhead"},
224853c0dc5SEd Tanous     {ReadCachePolicyType::Off, "Off"},
225853c0dc5SEd Tanous });
226853c0dc5SEd Tanous 
227853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(WriteCachePolicyType, {
228853c0dc5SEd Tanous     {WriteCachePolicyType::Invalid, "Invalid"},
229853c0dc5SEd Tanous     {WriteCachePolicyType::WriteThrough, "WriteThrough"},
230853c0dc5SEd Tanous     {WriteCachePolicyType::ProtectedWriteBack, "ProtectedWriteBack"},
231853c0dc5SEd Tanous     {WriteCachePolicyType::UnprotectedWriteBack, "UnprotectedWriteBack"},
232853c0dc5SEd Tanous     {WriteCachePolicyType::Off, "Off"},
233853c0dc5SEd Tanous });
234853c0dc5SEd Tanous 
235853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(WriteCacheStateType, {
236853c0dc5SEd Tanous     {WriteCacheStateType::Invalid, "Invalid"},
237853c0dc5SEd Tanous     {WriteCacheStateType::Unprotected, "Unprotected"},
238853c0dc5SEd Tanous     {WriteCacheStateType::Protected, "Protected"},
239853c0dc5SEd Tanous     {WriteCacheStateType::Degraded, "Degraded"},
240853c0dc5SEd Tanous });
241853c0dc5SEd Tanous 
242853c0dc5SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LBAFormatType, {
243853c0dc5SEd Tanous     {LBAFormatType::Invalid, "Invalid"},
244853c0dc5SEd Tanous     {LBAFormatType::LBAFormat0, "LBAFormat0"},
245853c0dc5SEd Tanous     {LBAFormatType::LBAFormat1, "LBAFormat1"},
246853c0dc5SEd Tanous     {LBAFormatType::LBAFormat2, "LBAFormat2"},
247853c0dc5SEd Tanous     {LBAFormatType::LBAFormat3, "LBAFormat3"},
248853c0dc5SEd Tanous     {LBAFormatType::LBAFormat4, "LBAFormat4"},
249853c0dc5SEd Tanous     {LBAFormatType::LBAFormat5, "LBAFormat5"},
250853c0dc5SEd Tanous     {LBAFormatType::LBAFormat6, "LBAFormat6"},
251853c0dc5SEd Tanous     {LBAFormatType::LBAFormat7, "LBAFormat7"},
252853c0dc5SEd Tanous     {LBAFormatType::LBAFormat8, "LBAFormat8"},
253853c0dc5SEd Tanous     {LBAFormatType::LBAFormat9, "LBAFormat9"},
254853c0dc5SEd Tanous     {LBAFormatType::LBAFormat10, "LBAFormat10"},
255853c0dc5SEd Tanous     {LBAFormatType::LBAFormat11, "LBAFormat11"},
256853c0dc5SEd Tanous     {LBAFormatType::LBAFormat12, "LBAFormat12"},
257853c0dc5SEd Tanous     {LBAFormatType::LBAFormat13, "LBAFormat13"},
258853c0dc5SEd Tanous     {LBAFormatType::LBAFormat14, "LBAFormat14"},
259853c0dc5SEd Tanous     {LBAFormatType::LBAFormat15, "LBAFormat15"},
260853c0dc5SEd Tanous });
261853c0dc5SEd Tanous 
262f263e09cSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(NamespaceType, {
263f263e09cSEd Tanous     {NamespaceType::Invalid, "Invalid"},
264f263e09cSEd Tanous     {NamespaceType::Block, "Block"},
265f263e09cSEd Tanous     {NamespaceType::KeyValue, "KeyValue"},
266f263e09cSEd Tanous     {NamespaceType::ZNS, "ZNS"},
267f263e09cSEd Tanous     {NamespaceType::Computational, "Computational"},
268f263e09cSEd Tanous });
269f263e09cSEd Tanous 
270f263e09cSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(OperationType, {
271f263e09cSEd Tanous     {OperationType::Invalid, "Invalid"},
272f263e09cSEd Tanous     {OperationType::Deduplicate, "Deduplicate"},
273f263e09cSEd Tanous     {OperationType::CheckConsistency, "CheckConsistency"},
274f263e09cSEd Tanous     {OperationType::Initialize, "Initialize"},
275f263e09cSEd Tanous     {OperationType::Replicate, "Replicate"},
276f263e09cSEd Tanous     {OperationType::Delete, "Delete"},
277f263e09cSEd Tanous     {OperationType::ChangeRAIDType, "ChangeRAIDType"},
278f263e09cSEd Tanous     {OperationType::Rebuild, "Rebuild"},
279f263e09cSEd Tanous     {OperationType::Encrypt, "Encrypt"},
280f263e09cSEd Tanous     {OperationType::Decrypt, "Decrypt"},
281f263e09cSEd Tanous     {OperationType::Resize, "Resize"},
282f263e09cSEd Tanous     {OperationType::Compress, "Compress"},
283f263e09cSEd Tanous     {OperationType::Sanitize, "Sanitize"},
284f263e09cSEd Tanous     {OperationType::Format, "Format"},
285*e9cc1bc9SEd Tanous     {OperationType::ChangeStripSize, "ChangeStripSize"},
286f263e09cSEd Tanous });
287f263e09cSEd Tanous 
288f263e09cSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LBARelativePerformanceType, {
289f263e09cSEd Tanous     {LBARelativePerformanceType::Invalid, "Invalid"},
290f263e09cSEd Tanous     {LBARelativePerformanceType::Best, "Best"},
291f263e09cSEd Tanous     {LBARelativePerformanceType::Better, "Better"},
292f263e09cSEd Tanous     {LBARelativePerformanceType::Good, "Good"},
293f263e09cSEd Tanous     {LBARelativePerformanceType::Degraded, "Degraded"},
294f263e09cSEd Tanous });
295f263e09cSEd Tanous 
296853c0dc5SEd Tanous }
297853c0dc5SEd Tanous // clang-format on
298