10ec8b83dSEd Tanous #pragma once 20ec8b83dSEd Tanous #include <nlohmann/json.hpp> 30ec8b83dSEd Tanous 40ec8b83dSEd Tanous namespace resource 50ec8b83dSEd Tanous { 60ec8b83dSEd Tanous // clang-format off 70ec8b83dSEd Tanous 80ec8b83dSEd Tanous enum class State{ 90ec8b83dSEd Tanous Invalid, 100ec8b83dSEd Tanous Enabled, 110ec8b83dSEd Tanous Disabled, 120ec8b83dSEd Tanous StandbyOffline, 130ec8b83dSEd Tanous StandbySpare, 140ec8b83dSEd Tanous InTest, 150ec8b83dSEd Tanous Starting, 160ec8b83dSEd Tanous Absent, 170ec8b83dSEd Tanous UnavailableOffline, 180ec8b83dSEd Tanous Deferring, 190ec8b83dSEd Tanous Quiesced, 200ec8b83dSEd Tanous Updating, 210ec8b83dSEd Tanous Qualified, 22*f2a8e57eSGunnar Mills Degraded, 230ec8b83dSEd Tanous }; 240ec8b83dSEd Tanous 250ec8b83dSEd Tanous enum class Health{ 260ec8b83dSEd Tanous Invalid, 270ec8b83dSEd Tanous OK, 280ec8b83dSEd Tanous Warning, 290ec8b83dSEd Tanous Critical, 300ec8b83dSEd Tanous }; 310ec8b83dSEd Tanous 320ec8b83dSEd Tanous enum class ResetType{ 330ec8b83dSEd Tanous Invalid, 340ec8b83dSEd Tanous On, 350ec8b83dSEd Tanous ForceOff, 360ec8b83dSEd Tanous GracefulShutdown, 370ec8b83dSEd Tanous GracefulRestart, 380ec8b83dSEd Tanous ForceRestart, 390ec8b83dSEd Tanous Nmi, 400ec8b83dSEd Tanous ForceOn, 410ec8b83dSEd Tanous PushPowerButton, 420ec8b83dSEd Tanous PowerCycle, 430ec8b83dSEd Tanous Suspend, 440ec8b83dSEd Tanous Pause, 450ec8b83dSEd Tanous Resume, 460ec8b83dSEd Tanous }; 470ec8b83dSEd Tanous 480ec8b83dSEd Tanous enum class IndicatorLED{ 490ec8b83dSEd Tanous Invalid, 500ec8b83dSEd Tanous Lit, 510ec8b83dSEd Tanous Blinking, 520ec8b83dSEd Tanous Off, 530ec8b83dSEd Tanous }; 540ec8b83dSEd Tanous 550ec8b83dSEd Tanous enum class PowerState{ 560ec8b83dSEd Tanous Invalid, 570ec8b83dSEd Tanous On, 580ec8b83dSEd Tanous Off, 590ec8b83dSEd Tanous PoweringOn, 600ec8b83dSEd Tanous PoweringOff, 610ec8b83dSEd Tanous Paused, 620ec8b83dSEd Tanous }; 630ec8b83dSEd Tanous 640ec8b83dSEd Tanous enum class DurableNameFormat{ 650ec8b83dSEd Tanous Invalid, 660ec8b83dSEd Tanous NAA, 670ec8b83dSEd Tanous iQN, 680ec8b83dSEd Tanous FC_WWN, 690ec8b83dSEd Tanous UUID, 700ec8b83dSEd Tanous EUI, 710ec8b83dSEd Tanous NQN, 720ec8b83dSEd Tanous NSID, 730ec8b83dSEd Tanous NGUID, 740ec8b83dSEd Tanous MACAddress, 75a8d8f9d8SEd Tanous GCXLID, 760ec8b83dSEd Tanous }; 770ec8b83dSEd Tanous 780ec8b83dSEd Tanous enum class RackUnits{ 790ec8b83dSEd Tanous Invalid, 800ec8b83dSEd Tanous OpenU, 810ec8b83dSEd Tanous EIA_310, 820ec8b83dSEd Tanous }; 830ec8b83dSEd Tanous 840ec8b83dSEd Tanous enum class LocationType{ 850ec8b83dSEd Tanous Invalid, 860ec8b83dSEd Tanous Slot, 870ec8b83dSEd Tanous Bay, 880ec8b83dSEd Tanous Connector, 890ec8b83dSEd Tanous Socket, 900ec8b83dSEd Tanous Backplane, 910ec8b83dSEd Tanous Embedded, 920ec8b83dSEd Tanous }; 930ec8b83dSEd Tanous 940ec8b83dSEd Tanous enum class Reference{ 950ec8b83dSEd Tanous Invalid, 960ec8b83dSEd Tanous Top, 970ec8b83dSEd Tanous Bottom, 980ec8b83dSEd Tanous Front, 990ec8b83dSEd Tanous Rear, 1000ec8b83dSEd Tanous Left, 1010ec8b83dSEd Tanous Right, 1020ec8b83dSEd Tanous Middle, 1030ec8b83dSEd Tanous }; 1040ec8b83dSEd Tanous 1050ec8b83dSEd Tanous enum class Orientation{ 1060ec8b83dSEd Tanous Invalid, 1070ec8b83dSEd Tanous FrontToBack, 1080ec8b83dSEd Tanous BackToFront, 1090ec8b83dSEd Tanous TopToBottom, 1100ec8b83dSEd Tanous BottomToTop, 1110ec8b83dSEd Tanous LeftToRight, 1120ec8b83dSEd Tanous RightToLeft, 1130ec8b83dSEd Tanous }; 1140ec8b83dSEd Tanous 1150ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(State, { 1160ec8b83dSEd Tanous {State::Invalid, "Invalid"}, 1170ec8b83dSEd Tanous {State::Enabled, "Enabled"}, 1180ec8b83dSEd Tanous {State::Disabled, "Disabled"}, 1190ec8b83dSEd Tanous {State::StandbyOffline, "StandbyOffline"}, 1200ec8b83dSEd Tanous {State::StandbySpare, "StandbySpare"}, 1210ec8b83dSEd Tanous {State::InTest, "InTest"}, 1220ec8b83dSEd Tanous {State::Starting, "Starting"}, 1230ec8b83dSEd Tanous {State::Absent, "Absent"}, 1240ec8b83dSEd Tanous {State::UnavailableOffline, "UnavailableOffline"}, 1250ec8b83dSEd Tanous {State::Deferring, "Deferring"}, 1260ec8b83dSEd Tanous {State::Quiesced, "Quiesced"}, 1270ec8b83dSEd Tanous {State::Updating, "Updating"}, 1280ec8b83dSEd Tanous {State::Qualified, "Qualified"}, 129*f2a8e57eSGunnar Mills {State::Degraded, "Degraded"}, 1300ec8b83dSEd Tanous }); 1310ec8b83dSEd Tanous 1320ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(Health, { 1330ec8b83dSEd Tanous {Health::Invalid, "Invalid"}, 1340ec8b83dSEd Tanous {Health::OK, "OK"}, 1350ec8b83dSEd Tanous {Health::Warning, "Warning"}, 1360ec8b83dSEd Tanous {Health::Critical, "Critical"}, 1370ec8b83dSEd Tanous }); 1380ec8b83dSEd Tanous 1390ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(ResetType, { 1400ec8b83dSEd Tanous {ResetType::Invalid, "Invalid"}, 1410ec8b83dSEd Tanous {ResetType::On, "On"}, 1420ec8b83dSEd Tanous {ResetType::ForceOff, "ForceOff"}, 1430ec8b83dSEd Tanous {ResetType::GracefulShutdown, "GracefulShutdown"}, 1440ec8b83dSEd Tanous {ResetType::GracefulRestart, "GracefulRestart"}, 1450ec8b83dSEd Tanous {ResetType::ForceRestart, "ForceRestart"}, 1460ec8b83dSEd Tanous {ResetType::Nmi, "Nmi"}, 1470ec8b83dSEd Tanous {ResetType::ForceOn, "ForceOn"}, 1480ec8b83dSEd Tanous {ResetType::PushPowerButton, "PushPowerButton"}, 1490ec8b83dSEd Tanous {ResetType::PowerCycle, "PowerCycle"}, 1500ec8b83dSEd Tanous {ResetType::Suspend, "Suspend"}, 1510ec8b83dSEd Tanous {ResetType::Pause, "Pause"}, 1520ec8b83dSEd Tanous {ResetType::Resume, "Resume"}, 1530ec8b83dSEd Tanous }); 1540ec8b83dSEd Tanous 1550ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, { 1560ec8b83dSEd Tanous {IndicatorLED::Invalid, "Invalid"}, 1570ec8b83dSEd Tanous {IndicatorLED::Lit, "Lit"}, 1580ec8b83dSEd Tanous {IndicatorLED::Blinking, "Blinking"}, 1590ec8b83dSEd Tanous {IndicatorLED::Off, "Off"}, 1600ec8b83dSEd Tanous }); 1610ec8b83dSEd Tanous 1620ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(PowerState, { 1630ec8b83dSEd Tanous {PowerState::Invalid, "Invalid"}, 1640ec8b83dSEd Tanous {PowerState::On, "On"}, 1650ec8b83dSEd Tanous {PowerState::Off, "Off"}, 1660ec8b83dSEd Tanous {PowerState::PoweringOn, "PoweringOn"}, 1670ec8b83dSEd Tanous {PowerState::PoweringOff, "PoweringOff"}, 1680ec8b83dSEd Tanous {PowerState::Paused, "Paused"}, 1690ec8b83dSEd Tanous }); 1700ec8b83dSEd Tanous 1710ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(DurableNameFormat, { 1720ec8b83dSEd Tanous {DurableNameFormat::Invalid, "Invalid"}, 1730ec8b83dSEd Tanous {DurableNameFormat::NAA, "NAA"}, 1740ec8b83dSEd Tanous {DurableNameFormat::iQN, "iQN"}, 1750ec8b83dSEd Tanous {DurableNameFormat::FC_WWN, "FC_WWN"}, 1760ec8b83dSEd Tanous {DurableNameFormat::UUID, "UUID"}, 1770ec8b83dSEd Tanous {DurableNameFormat::EUI, "EUI"}, 1780ec8b83dSEd Tanous {DurableNameFormat::NQN, "NQN"}, 1790ec8b83dSEd Tanous {DurableNameFormat::NSID, "NSID"}, 1800ec8b83dSEd Tanous {DurableNameFormat::NGUID, "NGUID"}, 1810ec8b83dSEd Tanous {DurableNameFormat::MACAddress, "MACAddress"}, 182a8d8f9d8SEd Tanous {DurableNameFormat::GCXLID, "GCXLID"}, 1830ec8b83dSEd Tanous }); 1840ec8b83dSEd Tanous 1850ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(RackUnits, { 1860ec8b83dSEd Tanous {RackUnits::Invalid, "Invalid"}, 1870ec8b83dSEd Tanous {RackUnits::OpenU, "OpenU"}, 1880ec8b83dSEd Tanous {RackUnits::EIA_310, "EIA_310"}, 1890ec8b83dSEd Tanous }); 1900ec8b83dSEd Tanous 1910ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LocationType, { 1920ec8b83dSEd Tanous {LocationType::Invalid, "Invalid"}, 1930ec8b83dSEd Tanous {LocationType::Slot, "Slot"}, 1940ec8b83dSEd Tanous {LocationType::Bay, "Bay"}, 1950ec8b83dSEd Tanous {LocationType::Connector, "Connector"}, 1960ec8b83dSEd Tanous {LocationType::Socket, "Socket"}, 1970ec8b83dSEd Tanous {LocationType::Backplane, "Backplane"}, 1980ec8b83dSEd Tanous {LocationType::Embedded, "Embedded"}, 1990ec8b83dSEd Tanous }); 2000ec8b83dSEd Tanous 2010ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(Reference, { 2020ec8b83dSEd Tanous {Reference::Invalid, "Invalid"}, 2030ec8b83dSEd Tanous {Reference::Top, "Top"}, 2040ec8b83dSEd Tanous {Reference::Bottom, "Bottom"}, 2050ec8b83dSEd Tanous {Reference::Front, "Front"}, 2060ec8b83dSEd Tanous {Reference::Rear, "Rear"}, 2070ec8b83dSEd Tanous {Reference::Left, "Left"}, 2080ec8b83dSEd Tanous {Reference::Right, "Right"}, 2090ec8b83dSEd Tanous {Reference::Middle, "Middle"}, 2100ec8b83dSEd Tanous }); 2110ec8b83dSEd Tanous 2120ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(Orientation, { 2130ec8b83dSEd Tanous {Orientation::Invalid, "Invalid"}, 2140ec8b83dSEd Tanous {Orientation::FrontToBack, "FrontToBack"}, 2150ec8b83dSEd Tanous {Orientation::BackToFront, "BackToFront"}, 2160ec8b83dSEd Tanous {Orientation::TopToBottom, "TopToBottom"}, 2170ec8b83dSEd Tanous {Orientation::BottomToTop, "BottomToTop"}, 2180ec8b83dSEd Tanous {Orientation::LeftToRight, "LeftToRight"}, 2190ec8b83dSEd Tanous {Orientation::RightToLeft, "RightToLeft"}, 2200ec8b83dSEd Tanous }); 2210ec8b83dSEd Tanous 2220ec8b83dSEd Tanous } 2230ec8b83dSEd Tanous // clang-format on 224