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 NLOHMANN_JSON_SERIALIZE_ENUM(MediaType, {
86     {MediaType::Invalid, "Invalid"},
87     {MediaType::HDD, "HDD"},
88     {MediaType::SSD, "SSD"},
89     {MediaType::SMR, "SMR"},
90 });
91 
92 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareType, {
93     {HotspareType::Invalid, "Invalid"},
94     {HotspareType::None, "None"},
95     {HotspareType::Global, "Global"},
96     {HotspareType::Chassis, "Chassis"},
97     {HotspareType::Dedicated, "Dedicated"},
98 });
99 
100 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionAbility, {
101     {EncryptionAbility::Invalid, "Invalid"},
102     {EncryptionAbility::None, "None"},
103     {EncryptionAbility::SelfEncryptingDrive, "SelfEncryptingDrive"},
104     {EncryptionAbility::Other, "Other"},
105 });
106 
107 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionStatus, {
108     {EncryptionStatus::Invalid, "Invalid"},
109     {EncryptionStatus::Unecrypted, "Unecrypted"},
110     {EncryptionStatus::Unlocked, "Unlocked"},
111     {EncryptionStatus::Locked, "Locked"},
112     {EncryptionStatus::Foreign, "Foreign"},
113     {EncryptionStatus::Unencrypted, "Unencrypted"},
114 });
115 
116 NLOHMANN_JSON_SERIALIZE_ENUM(StatusIndicator, {
117     {StatusIndicator::Invalid, "Invalid"},
118     {StatusIndicator::OK, "OK"},
119     {StatusIndicator::Fail, "Fail"},
120     {StatusIndicator::Rebuild, "Rebuild"},
121     {StatusIndicator::PredictiveFailureAnalysis, "PredictiveFailureAnalysis"},
122     {StatusIndicator::Hotspare, "Hotspare"},
123     {StatusIndicator::InACriticalArray, "InACriticalArray"},
124     {StatusIndicator::InAFailedArray, "InAFailedArray"},
125 });
126 
127 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareReplacementModeType, {
128     {HotspareReplacementModeType::Invalid, "Invalid"},
129     {HotspareReplacementModeType::Revertible, "Revertible"},
130     {HotspareReplacementModeType::NonRevertible, "NonRevertible"},
131 });
132 
133 NLOHMANN_JSON_SERIALIZE_ENUM(DataSanitizationType, {
134     {DataSanitizationType::Invalid, "Invalid"},
135     {DataSanitizationType::BlockErase, "BlockErase"},
136     {DataSanitizationType::CryptographicErase, "CryptographicErase"},
137     {DataSanitizationType::Overwrite, "Overwrite"},
138 });
139 
140 NLOHMANN_JSON_SERIALIZE_ENUM(FormFactor, {
141     {FormFactor::Invalid, "Invalid"},
142     {FormFactor::Drive3_5, "Drive3_5"},
143     {FormFactor::Drive2_5, "Drive2_5"},
144     {FormFactor::EDSFF, "EDSFF"},
145     {FormFactor::EDSFF_1U_Long, "EDSFF_1U_Long"},
146     {FormFactor::EDSFF_1U_Short, "EDSFF_1U_Short"},
147     {FormFactor::EDSFF_E3_Short, "EDSFF_E3_Short"},
148     {FormFactor::EDSFF_E3_Long, "EDSFF_E3_Long"},
149     {FormFactor::M2, "M2"},
150     {FormFactor::M2_2230, "M2_2230"},
151     {FormFactor::M2_2242, "M2_2242"},
152     {FormFactor::M2_2260, "M2_2260"},
153     {FormFactor::M2_2280, "M2_2280"},
154     {FormFactor::M2_22110, "M2_22110"},
155     {FormFactor::U2, "U2"},
156     {FormFactor::PCIeSlotFullLength, "PCIeSlotFullLength"},
157     {FormFactor::PCIeSlotLowProfile, "PCIeSlotLowProfile"},
158     {FormFactor::PCIeHalfLength, "PCIeHalfLength"},
159     {FormFactor::OEM, "OEM"},
160 });
161 
162 }
163 // clang-format on
164