blob: 924274ace0928c2fbb90afb6ef28f07c8a8d5739 [file] [log] [blame]
#pragma once
#include <cstdint>
#include <nlohmann/json.hpp>
namespace resource
{
// clang-format off
enum class State : std::uint8_t{
Invalid,
Enabled,
Disabled,
StandbyOffline,
StandbySpare,
InTest,
Starting,
Absent,
UnavailableOffline,
Deferring,
Quiesced,
Updating,
Qualified,
};
enum class Health : std::uint8_t{
Invalid,
OK,
Warning,
Critical,
};
enum class ResetType : std::uint8_t{
Invalid,
On,
ForceOff,
GracefulShutdown,
GracefulRestart,
ForceRestart,
Nmi,
ForceOn,
PushPowerButton,
PowerCycle,
Suspend,
Pause,
Resume,
};
enum class IndicatorLED : std::uint8_t{
Invalid,
Lit,
Blinking,
Off,
};
enum class PowerState : std::uint8_t{
Invalid,
On,
Off,
PoweringOn,
PoweringOff,
Paused,
};
enum class DurableNameFormat : std::uint8_t{
Invalid,
NAA,
iQN,
FC_WWN,
UUID,
EUI,
NQN,
NSID,
NGUID,
MACAddress,
GCXLID,
};
enum class RackUnits : std::uint8_t{
Invalid,
OpenU,
EIA_310,
};
enum class LocationType : std::uint8_t{
Invalid,
Slot,
Bay,
Connector,
Socket,
Backplane,
Embedded,
};
enum class Reference : std::uint8_t{
Invalid,
Top,
Bottom,
Front,
Rear,
Left,
Right,
Middle,
};
enum class Orientation : std::uint8_t{
Invalid,
FrontToBack,
BackToFront,
TopToBottom,
BottomToTop,
LeftToRight,
RightToLeft,
};
NLOHMANN_JSON_SERIALIZE_ENUM(State, {
{State::Invalid, "Invalid"},
{State::Enabled, "Enabled"},
{State::Disabled, "Disabled"},
{State::StandbyOffline, "StandbyOffline"},
{State::StandbySpare, "StandbySpare"},
{State::InTest, "InTest"},
{State::Starting, "Starting"},
{State::Absent, "Absent"},
{State::UnavailableOffline, "UnavailableOffline"},
{State::Deferring, "Deferring"},
{State::Quiesced, "Quiesced"},
{State::Updating, "Updating"},
{State::Qualified, "Qualified"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(Health, {
{Health::Invalid, "Invalid"},
{Health::OK, "OK"},
{Health::Warning, "Warning"},
{Health::Critical, "Critical"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(ResetType, {
{ResetType::Invalid, "Invalid"},
{ResetType::On, "On"},
{ResetType::ForceOff, "ForceOff"},
{ResetType::GracefulShutdown, "GracefulShutdown"},
{ResetType::GracefulRestart, "GracefulRestart"},
{ResetType::ForceRestart, "ForceRestart"},
{ResetType::Nmi, "Nmi"},
{ResetType::ForceOn, "ForceOn"},
{ResetType::PushPowerButton, "PushPowerButton"},
{ResetType::PowerCycle, "PowerCycle"},
{ResetType::Suspend, "Suspend"},
{ResetType::Pause, "Pause"},
{ResetType::Resume, "Resume"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, {
{IndicatorLED::Invalid, "Invalid"},
{IndicatorLED::Lit, "Lit"},
{IndicatorLED::Blinking, "Blinking"},
{IndicatorLED::Off, "Off"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(PowerState, {
{PowerState::Invalid, "Invalid"},
{PowerState::On, "On"},
{PowerState::Off, "Off"},
{PowerState::PoweringOn, "PoweringOn"},
{PowerState::PoweringOff, "PoweringOff"},
{PowerState::Paused, "Paused"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(DurableNameFormat, {
{DurableNameFormat::Invalid, "Invalid"},
{DurableNameFormat::NAA, "NAA"},
{DurableNameFormat::iQN, "iQN"},
{DurableNameFormat::FC_WWN, "FC_WWN"},
{DurableNameFormat::UUID, "UUID"},
{DurableNameFormat::EUI, "EUI"},
{DurableNameFormat::NQN, "NQN"},
{DurableNameFormat::NSID, "NSID"},
{DurableNameFormat::NGUID, "NGUID"},
{DurableNameFormat::MACAddress, "MACAddress"},
{DurableNameFormat::GCXLID, "GCXLID"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(RackUnits, {
{RackUnits::Invalid, "Invalid"},
{RackUnits::OpenU, "OpenU"},
{RackUnits::EIA_310, "EIA_310"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(LocationType, {
{LocationType::Invalid, "Invalid"},
{LocationType::Slot, "Slot"},
{LocationType::Bay, "Bay"},
{LocationType::Connector, "Connector"},
{LocationType::Socket, "Socket"},
{LocationType::Backplane, "Backplane"},
{LocationType::Embedded, "Embedded"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(Reference, {
{Reference::Invalid, "Invalid"},
{Reference::Top, "Top"},
{Reference::Bottom, "Bottom"},
{Reference::Front, "Front"},
{Reference::Rear, "Rear"},
{Reference::Left, "Left"},
{Reference::Right, "Right"},
{Reference::Middle, "Middle"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(Orientation, {
{Orientation::Invalid, "Invalid"},
{Orientation::FrontToBack, "FrontToBack"},
{Orientation::BackToFront, "BackToFront"},
{Orientation::TopToBottom, "TopToBottom"},
{Orientation::BottomToTop, "BottomToTop"},
{Orientation::LeftToRight, "LeftToRight"},
{Orientation::RightToLeft, "RightToLeft"},
});
} // namespace resource
// clang-format on