blob: 11530bf3cc3da75cea9b7b1a8ca091cafe50aa5f [file] [log] [blame]
Patrick Venture02e32372019-08-16 10:50:18 -07001#pragma once
2
3#include <ipmid/types.hpp>
4#include <nlohmann/json.hpp>
5
6namespace ipmi
7{
8namespace sensor
9{
10
11/**
Patrick Venturec2b7fc12019-08-19 11:53:22 -070012 * @brief Open the default entity map json file, and if present and valid json,
13 * return a built entity map.
14 *
15 * @return the map
16 */
17EntityInfoMap buildEntityMapFromFile();
18
19/**
Patrick Venture02e32372019-08-16 10:50:18 -070020 * @brief Given json data validate the data matches the expected format for the
21 * entity map configuration and parse the data into a map of the entities.
22 *
23 * If any entry is invalid, the entire contents passed in is disregarded as
24 * possibly corrupt.
25 *
26 * @param[in] data - the json data
27 * @return the map
28 */
29EntityInfoMap buildJsonEntityMap(const nlohmann::json& data);
30
31} // namespace sensor
32} // namespace ipmi