diff options
author | SunnySrivastava1984 <sunnsr25@in.ibm.com> | 2020-12-15 21:42:19 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-02-22 19:30:47 +0300 |
commit | ee135e246d8348048b5409b5ed0b81d9c1820c30 (patch) | |
tree | 785d6855630c06b55d929770e32449714b08881b | |
parent | 753129816c8494466c64cf6681de97b18e56718f (diff) | |
download | bmcweb-ee135e246d8348048b5409b5ed0b81d9c1820c30.tar.xz |
Add additional Redfish Memory properties
This commit adds the following properties to the memory
schema on bmcweb.
a) LocationCode, a free form, implementation-defined string
to provide the location of the DIMM. This is needed so an
implementation can identify the DIMM via system diagrams and such.
b) Model, maps to a CCIN/Card ID for IBM's implementation,
is a string for the manufacturer's part model. For IBM's
implementation, it is a four-digit value assigned for each
possible FRU.
c) SparePartNumber, also field-replaceable unit (FRU) Part Number,
is a part number that identifies the FRU for replacement
specifically ordering of a new part.
Redfish validator has been executed on this change and no new
error was found.
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: I419a9cd8e956de3fbf7093903129389ad5e0e577
-rw-r--r-- | redfish-core/lib/memory.hpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp index c85b0001bc..f6be846d9b 100644 --- a/redfish-core/lib/memory.hpp +++ b/redfish-core/lib/memory.hpp @@ -672,6 +672,41 @@ inline void getDimmDataByService(std::shared_ptr<AsyncResp> aResp, aResp->res.jsonValue["MemoryLocation"][property.first] = *value; } + else if (property.first == "SparePartNumber") + { + const std::string* value = + std::get_if<std::string>(&property.second); + if (value == nullptr) + { + messages::internalError(aResp->res); + continue; + } + aResp->res.jsonValue["SparePartNumber"] = *value; + } + else if (property.first == "Model") + { + const std::string* value = + std::get_if<std::string>(&property.second); + if (value == nullptr) + { + messages::internalError(aResp->res); + continue; + } + aResp->res.jsonValue["Model"] = *value; + } + else if (property.first == "LocationCode") + { + const std::string* value = + std::get_if<std::string>(&property.second); + if (value == nullptr) + { + messages::internalError(aResp->res); + continue; + } + aResp->res + .jsonValue["Location"]["PartLocation"]["ServiceLabel"] = + *value; + } else { getPersistentMemoryProperties(aResp, properties); @@ -900,7 +935,7 @@ class Memory : public Node } const std::string& dimmId = params[0]; - res.jsonValue["@odata.type"] = "#Memory.v1_7_0.Memory"; + res.jsonValue["@odata.type"] = "#Memory.v1_11_0.Memory"; res.jsonValue["@odata.id"] = "/redfish/v1/Systems/system/Memory/" + dimmId; auto asyncResp = std::make_shared<AsyncResp>(res); |