Get Inventory list using unexpanded location code
This commit implements an api to get inventory list with respect to
a given location code in un-expanded format.
Along with location code node also needs to be passed.
In case no inventory is found at the given location or location code
is not correct, corresponding error is returned to the caller.
Tested on simics.
This api is under com.ibm.vpd.Manager interface. So vpd-manager app
needs to be running for this api to work.
Sample command for simics:
busctl call com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager
GetFRUsByUnexpandedLocationCode sq <location_code> <node_number>
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: I87159d2a3c293e82c9e82d21a9d281bd176a30e7
diff --git a/vpd-manager/manager.cpp b/vpd-manager/manager.cpp
index 1ce1cd1..347aade 100644
--- a/vpd-manager/manager.cpp
+++ b/vpd-manager/manager.cpp
@@ -5,8 +5,10 @@
#include "editor_impl.hpp"
#include "parser.hpp"
#include "reader_impl.hpp"
+#include "utils.hpp"
using namespace openpower::vpd::constants;
+using namespace openpower::vpd::inventory;
using namespace openpower::vpd::manager::editor;
using namespace openpower::vpd::manager::reader;
@@ -126,14 +128,15 @@
}
}
-std::vector<sdbusplus::message::object_path>
+ListOfPaths
Manager::getFRUsByUnexpandedLocationCode(const std::string locationCode,
const uint16_t nodeNumber)
{
- // implement the interface
+ ReaderImpl read;
+ return read.getFrusAtLocation(locationCode, nodeNumber, fruLocationCode);
}
-std::vector<sdbusplus::message::object_path>
+ListOfPaths
Manager::getFRUsByExpandedLocationCode(const std::string locationCode)
{
// implement the interface