mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-21 16:57:58 +02:00
Set CheckResult to execeution
This commit is contained in:
parent
ed4dc708ca
commit
58bc2bb848
@ -990,6 +990,14 @@ Value ClusterEvents::ExecutedCommandAPIHandler(const MessageOrigin::Ptr& origin,
|
||||
return Empty;
|
||||
}
|
||||
|
||||
if (!params->Contains("check_result")) {
|
||||
Log(LogNotice, "ClusterEvents")
|
||||
<< "Discarding 'update executions API handler' message for checkable '" << checkable->GetName()
|
||||
<< "' from '" << origin->FromClient->GetIdentity() << "': No check result available.";
|
||||
return Empty;
|
||||
}
|
||||
CheckResult::Ptr cr = params->Get("check_result");
|
||||
|
||||
Dictionary::Ptr execution = executions->Get(uuid);
|
||||
if (!execution) {
|
||||
Log(LogNotice, "ClusterEvents")
|
||||
@ -999,8 +1007,7 @@ Value ClusterEvents::ExecutedCommandAPIHandler(const MessageOrigin::Ptr& origin,
|
||||
}
|
||||
|
||||
execution->Set("pending", false);
|
||||
|
||||
/* TODO update execution with the command result */
|
||||
execution->Set("check_result", cr);
|
||||
|
||||
/* Broadcast the update */
|
||||
Dictionary::Ptr executionsToBroadcast = new Dictionary();
|
||||
@ -1018,7 +1025,7 @@ Value ClusterEvents::ExecutedCommandAPIHandler(const MessageOrigin::Ptr& origin,
|
||||
|
||||
listener->RelayMessage(origin, checkable, updateMessage, true);
|
||||
|
||||
return "Not implemented";
|
||||
return Empty;
|
||||
}
|
||||
|
||||
Value ClusterEvents::UpdateExecutionsAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
|
||||
|
Loading…
x
Reference in New Issue
Block a user