blob: 61609e42ae65dfb0e3124b0b12c3fc57d1279289 [file] [log] [blame]
Jayanth Othayothc4831812021-06-08 01:33:40 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4
5#include <string>
6
7namespace openpower
8{
9namespace util
10{
11/**
12 * Get D-Bus service name for the specified object and interface
13 *
14 * @param[in] bus - sdbusplus D-Bus to attach to
15 * @param[in] objectPath - D-Bus object path
16 * @param[in] interface - D-Bus interface name
17 *
18 * @return service name on success and exception on failure
19 */
Patrick Williamsaaea6862022-07-22 19:26:54 -050020std::string getService(sdbusplus::bus_t& bus, const std::string& objectPath,
Jayanth Othayothc4831812021-06-08 01:33:40 -050021 const std::string& interface);
Marri Devender Rao4d5b5bf2022-05-23 09:23:31 -050022
23/**
24 * Returns true if host is in poweringoff state else false
25 *
26 * @return bool - true if host is powering off else false. if failed
27 * to read property false will be returned.
28 */
29bool isHostPoweringOff();
30
Jayanth Othayoth87441232022-09-08 23:47:11 -050031/**
32 * @brief Returns the power state for chassis0
33 * @return The chassis power state.
34 */
35std::string getChassisPowerState();
36
Jayanth Othayothc4831812021-06-08 01:33:40 -050037} // namespace util
38} // namespace openpower