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/reader_impl.hpp b/vpd-manager/reader_impl.hpp
index 17cfc75..465f414 100644
--- a/vpd-manager/reader_impl.hpp
+++ b/vpd-manager/reader_impl.hpp
@@ -36,9 +36,26 @@
const std::string& locationCode, const uint16_t& nodeNumber,
const inventory::LocationCodeMap& frusLocationCode) const;
+ /** @brief An api to get list of all the FRUs at the given location code
+ * @param[in] - location code in unexpanded format
+ * @param[in] - node number
+ * @param[in] - mapping of location code and Inventory path
+ * @return list of Inventory paths at the given location
+ */
+ inventory::ListOfPaths getFrusAtLocation(
+ const std::string& locationCode, const uint16_t& nodeNumber,
+ const inventory::LocationCodeMap& frusLocationCode) const;
+
+ private:
+ /** @brief An api to check validity of location code
+ * @param[in] - location code
+ * @return true/false based on validity check
+ */
+ bool isValidLocationCode(const std::string& locationCode) const;
+
}; // class ReaderImpl
} // namespace reader
} // namespace manager
} // namespace vpd
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower