blob: 027480f2db6f18bdf6a34f1a820d2c79460424cf [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
19using CreateIface = sdbusplus::server::object::object<
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 */
42 Manager(sdbusplus::bus::bus& bus, Mgr& dumpMgr, const char* path) :
43 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