| 768 | } |
| 769 | |
| 770 | void ClusterEvents::AcknowledgementSetHandler(const Checkable::Ptr& checkable, |
| 771 | const String& author, const String& comment, AcknowledgementType type, |
| 772 | bool notify, bool persistent, double changeTime, double expiry, const MessageOrigin::Ptr& origin) |
| 773 | { |
| 774 | ApiListener::Ptr listener = ApiListener::GetInstance(); |
| 775 | |
| 776 | if (!listener) |
| 777 | return; |
| 778 | |
| 779 | Host::Ptr host; |
| 780 | Service::Ptr service; |
| 781 | tie(host, service) = GetHostService(checkable); |
| 782 | |
| 783 | Dictionary::Ptr params = new Dictionary(); |
| 784 | params->Set("host", host->GetName()); |
| 785 | if (service) |
| 786 | params->Set("service", service->GetShortName()); |
| 787 | params->Set("author", author); |
| 788 | params->Set("comment", comment); |
| 789 | params->Set("acktype", type); |
| 790 | params->Set("notify", notify); |
| 791 | params->Set("persistent", persistent); |
| 792 | params->Set("expiry", expiry); |
| 793 | params->Set("change_time", changeTime); |
| 794 | |
| 795 | Dictionary::Ptr message = new Dictionary(); |
| 796 | message->Set("jsonrpc", "2.0"); |
| 797 | message->Set("method", "event::SetAcknowledgement"); |
| 798 | message->Set("params", params); |
| 799 | |
| 800 | listener->RelayMessage(origin, checkable, message, true); |
| 801 | } |
| 802 | |
| 803 | Value ClusterEvents::AcknowledgementSetAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params) |
| 804 | { |
nothing calls this directly
no test coverage detected