monitor:JSON: Parse fan definitions
Parse and create the list of fan definitions for monitoring from a JSON
configuration file.
Tested:
Fan definition list created same as from YAML
Any required parameters missing cause a runtime exception
Change-Id: Iafa194f01a48ed3445c5da6187db62cb4d2672d7
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/monitor/json_parser.hpp b/monitor/json_parser.hpp
index f8d1f4a..514d76b 100644
--- a/monitor/json_parser.hpp
+++ b/monitor/json_parser.hpp
@@ -57,4 +57,22 @@
*/
const std::vector<CreateGroupFunction> getTrustGrps(const json& obj);
+/**
+ * @brief Get the configured sensor definitions that make up a fan
+ *
+ * @param[in] sensor - JSON object containing a list of sensors
+ *
+ * @return List of sensor definition data that make up a fan being monitored
+ */
+const std::vector<SensorDefinition> getSensorDefs(const json& sensors);
+
+/**
+ * @brief Get the configured fan definitions to be monitored
+ *
+ * @param[in] obj - JSON object to parse from
+ *
+ * @return List of fan definition data on the fans to be monitored
+ */
+const std::vector<FanDefinition> getFanDefs(const json& obj);
+
} // namespace phosphor::fan::monitor