JSON and API prototype to update powerVS VPD

The commit introduces JSON file to hold the VPD that needs to be
updated for systems with PowerVS configuration.

It also adds API to fetch JSON as per system IM and prototype for API
which will checks the existing data and based on that will either skip
or update the VPD.

Change-Id: I5c279ce210831667be669c2a7c9c7d9c160de336
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
diff --git a/vpd-manager/src/manager.cpp b/vpd-manager/src/manager.cpp
index b608e0b..5f502cf 100644
--- a/vpd-manager/src/manager.cpp
+++ b/vpd-manager/src/manager.cpp
@@ -323,11 +323,18 @@
     });
 }
 
+void Manager::checkAndUpdatePowerVsVpd(
+    const nlohmann::json& i_powerVsJsonObj,
+    std::vector<std::string>& o_failedPathList)
+{
+    (void)i_powerVsJsonObj;
+    (void)o_failedPathList;
+    // TODO: Check and update powerVS VPD
+}
+
 void Manager::ConfigurePowerVsSystem()
 {
-    // This API should check for required powerVS configuration and will
-    // update the VPD accordingly.
-
+    std::vector<std::string> l_failedPathList;
     try
     {
         types::BinaryVector l_imValue = dbusUtility::getImFromDbus();
@@ -342,6 +349,22 @@
             // misconfigurations?
             return;
         }
+
+        const nlohmann::json& l_powerVsJsonObj =
+            jsonUtility::getPowerVsJson(l_imValue);
+
+        if (l_powerVsJsonObj.empty())
+        {
+            throw std::runtime_error("PowerVS Json not found");
+        }
+
+        checkAndUpdatePowerVsVpd(l_powerVsJsonObj, l_failedPathList);
+
+        if (!l_failedPathList.empty())
+        {
+            throw std::runtime_error(
+                "Part number update failed for following paths: ");
+        }
     }
     catch (const std::exception& l_ex)
     {