summaryrefslogtreecommitdiffstats
path: root/entity_map_json.hpp
blob: 54884eed66b6d1209ed071405a33c3a3e06698a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include <ipmid/types.hpp>
#include <nlohmann/json.hpp>

namespace ipmi
{
namespace sensor
{

/**
 * @brief Grab a handle to the entity map.
 */
const EntityInfoMap& getIpmiEntityRecords();

/**
 * @brief Open the default entity map json file, and if present and valid json,
 * return a built entity map.
 *
 * @return the map
 */
EntityInfoMap buildEntityMapFromFile();

/**
 * @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