Add TaskService
This adds tasks service to Redfish and creates an
example for crashdump. The TaskData object creates
tasks that can be updated based on d-bus matches. It
also has a configurable timeout using timers. Task
Monitor uses these task objects to reply with a 202
until the async task is done, then a 204 when it is
either failed or completed.
Messages support will come in future commit.
Tested: Validator passed, wrote script to poll monitor,
verified that got 202 with location header and retry-after
set correctly, then 204, then 404.
Change-Id: I109e671baa1c1eeff1a11ae578e7361bf6ef9f14
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index b1fd820..cba2882 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -33,6 +33,7 @@
#include "../lib/service_root.hpp"
#include "../lib/storage.hpp"
#include "../lib/systems.hpp"
+#include "../lib/task.hpp"
#include "../lib/thermal.hpp"
#include "../lib/update_service.hpp"
#ifdef BMCWEB_ENABLE_VM_NBDPROXY
@@ -165,6 +166,11 @@
nodes.emplace_back(std::make_unique<SensorCollection>(app));
nodes.emplace_back(std::make_unique<Sensor>(app));
+ nodes.emplace_back(std::make_unique<TaskMonitor>(app));
+ nodes.emplace_back(std::make_unique<TaskService>(app));
+ nodes.emplace_back(std::make_unique<TaskCollection>(app));
+ nodes.emplace_back(std::make_unique<Task>(app));
+
for (const auto& node : nodes)
{
node->initPrivileges();