summaryrefslogtreecommitdiffstats
path: root/entity_map_json.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'entity_map_json.hpp')
-rw-r--r--entity_map_json.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/entity_map_json.hpp b/entity_map_json.hpp
new file mode 100644
index 0000000..0e9be01
--- /dev/null
+++ b/entity_map_json.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <ipmid/types.hpp>
+#include <nlohmann/json.hpp>
+
+namespace ipmi
+{
+namespace sensor
+{
+
+/**
+ * @brief Given json data validate the data matches the expected format for the
+ * entity map configuration and parse the data into a map of the entities.
+ *
+ * If any entry is invalid, the entire contents passed in is disregarded as
+ * possibly corrupt.
+ *
+ * @param[in] data - the json data
+ * @return the map
+ */
+EntityInfoMap buildJsonEntityMap(const nlohmann::json& data);
+
+} // namespace sensor
+} // namespace ipmi
OpenPOWER on IntegriCloud