diff options
Diffstat (limited to 'redfish-core/lib/storage.hpp')
-rw-r--r-- | redfish-core/lib/storage.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp index 51635ce10f..30b679deea 100644 --- a/redfish-core/lib/storage.hpp +++ b/redfish-core/lib/storage.hpp @@ -467,6 +467,24 @@ inline void } asyncResp->res.jsonValue["Protocol"] = *proto; } + else if (propertyName == "PredictedMediaLifeLeftPercent") + { + const uint8_t* lifeLeft = + std::get_if<uint8_t>(&property.second); + if (lifeLeft == nullptr) + { + BMCWEB_LOG_ERROR + << "Illegal property: PredictedMediaLifeLeftPercent"; + messages::internalError(asyncResp->res); + return; + } + // 255 means reading the value is not supported + if (*lifeLeft != 255) + { + asyncResp->res.jsonValue["PredictedMediaLifeLeftPercent"] = + *lifeLeft; + } + } } }); } |