Task: Use TaskEvent messages
Task registry messages make more sense to use
for task events then standard registry entries
when applicable. Use them.
Tested:
"Messages": [
{
"@odata.type": "#Message.v1_0_0.Message",
"Message": "The task with id 0 has started.",
"MessageArgs": [
"0"
],
"MessageId": "TaskEvent.1.0.1.TaskStarted",
"Resolution": "None.",
"Severity": "OK"
}
],
Validator passed
Change-Id: I707492544e18def2833e8a2e2216ce803c42c775
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index e9793eb..60d6673 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -151,14 +151,16 @@
return task::completed;
}
+ std::string index =
+ std::to_string(taskData->index);
+
if (boost::ends_with(*state, "Invalid") ||
boost::ends_with(*state, "Failed"))
{
taskData->state = "Exception";
taskData->status = "Warning";
taskData->messages.emplace_back(
- messages::invalidObject(
- "/redfish/v1/UpdateService/"));
+ messages::taskAborted(index));
return task::completed;
}
@@ -171,7 +173,7 @@
if (boost::ends_with(*state, "Active"))
{
taskData->messages.emplace_back(
- messages::success());
+ messages::taskCompletedOK(index));
taskData->state = "Completed";
return task::completed;
}