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