blob: 7bd69cbf21e42a4d853edff65fac1c76802b8a1a [file] [log] [blame]
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05001#pragma once
2
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -05003#include "xyz/openbmc_project/Dump/Internal/Create/server.hpp"
4
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05005#include <sdbusplus/bus.hpp>
6#include <sdbusplus/server/object.hpp>
7
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05008namespace phosphor
9{
10namespace dump
11{
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050012namespace bmc
13{
Brad Bishopae871bd2018-10-18 16:32:05 -040014
15class Manager;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050016namespace internal
17{
18
Patrick Williams9b18bf22022-07-22 19:26:55 -050019using CreateIface = sdbusplus::server::object_t<
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050020 sdbusplus::xyz::openbmc_project::Dump::Internal::server::Create>;
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050021using Mgr = phosphor::dump::bmc::Manager;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050022
23/** @class Manager
24 * @brief Implementation for the
25 * xyz.openbmc_project.Dump.Internal.Create DBus API.
26 */
27class Manager : public CreateIface
28{
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050029 public:
30 Manager() = delete;
31 Manager(const Manager&) = delete;
32 Manager& operator=(const Manager&) = delete;
33 Manager(Manager&&) = delete;
34 Manager& operator=(Manager&&) = delete;
35 virtual ~Manager() = default;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050036
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050037 /** @brief Constructor to put object onto bus at a dbus path.
38 * @param[in] bus - Bus to attach to.
39 * @param[in] dumpMgr - Dump Manager object
40 * @param[in] path - Path to attach at.
41 */
Patrick Williams9b18bf22022-07-22 19:26:55 -050042 Manager(sdbusplus::bus_t& bus, Mgr& dumpMgr, const char* path) :
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050043 CreateIface(bus, path), dumpMgr(dumpMgr){};
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050044
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -050045 /** @brief Implementation for Create
46 * Create BMC Dump based on the Dump type.
47 *
48 * @param[in] type - Type of the Dump.
49 * @param[in] fullPaths - List of absolute paths to the files
50 * to be included as part of Dump package.
51 */
52 void create(Type type, std::vector<std::string> fullPaths) override;
53
54 private:
55 /** @brief Dump Manager object. */
56 Mgr& dumpMgr;
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050057};
58
59} // namespace internal
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050060} // namespace bmc
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050061} // namespace dump
62} // namespace phosphor