blob: 54884eed66b6d1209ed071405a33c3a3e06698a6 [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 Venture99bf1c42019-08-23 09:02:13 -070012 * @brief Grab a handle to the entity map.
13 */
14const EntityInfoMap& getIpmiEntityRecords();
15
16/**
Patrick Venturec2b7fc12019-08-19 11:53:22 -070017 * @brief Open the default entity map json file, and if present and valid json,
18 * return a built entity map.
19 *
20 * @return the map
21 */
22EntityInfoMap buildEntityMapFromFile();
23
24/**
Patrick Venture02e32372019-08-16 10:50:18 -070025 * @brief Given json data validate the data matches the expected format for the
26 * entity map configuration and parse the data into a map of the entities.
27 *
28 * If any entry is invalid, the entire contents passed in is disregarded as
29 * possibly corrupt.
30 *
31 * @param[in] data - the json data
32 * @return the map
33 */
34EntityInfoMap buildJsonEntityMap(const nlohmann::json& data);
35
36} // namespace sensor
37} // namespace ipmi