diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index 757b37eca68..f94e8feb8d0 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -31,6 +31,7 @@ REGISTER_APIACTION(remove_downtime, "Service;Host;Downtime", &ApiActions::Remove REGISTER_APIACTION(shutdown_process, "", &ApiActions::ShutdownProcess); REGISTER_APIACTION(restart_process, "", &ApiActions::RestartProcess); REGISTER_APIACTION(generate_ticket, "", &ApiActions::GenerateTicket); +REGISTER_APIACTION(execute_command, "Service;Host", &ApiActions::ExecuteCommand); Dictionary::Ptr ApiActions::CreateResult(int code, const String& status, const Dictionary::Ptr& additional) @@ -520,3 +521,9 @@ Dictionary::Ptr ApiActions::GenerateTicket(const ConfigObject::Ptr&, return ApiActions::CreateResult(200, "Generated PKI ticket '" + ticket + "' for common name '" + cn + "'.", additional); } + +Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object, + const Dictionary::Ptr& params) +{ + return ApiActions::CreateResult(501, "Not implemented"); +} diff --git a/lib/icinga/apiactions.hpp b/lib/icinga/apiactions.hpp index c2c8b6188d9..46e03c02f2a 100644 --- a/lib/icinga/apiactions.hpp +++ b/lib/icinga/apiactions.hpp @@ -29,6 +29,7 @@ class ApiActions static Dictionary::Ptr ShutdownProcess(const ConfigObject::Ptr& object, const Dictionary::Ptr& params); static Dictionary::Ptr RestartProcess(const ConfigObject::Ptr& object, const Dictionary::Ptr& params); static Dictionary::Ptr GenerateTicket(const ConfigObject::Ptr& object, const Dictionary::Ptr& params); + static Dictionary::Ptr ExecuteCommand(const ConfigObject::Ptr& object, const Dictionary::Ptr& params); private: static Dictionary::Ptr CreateResult(int code, const String& status, const Dictionary::Ptr& additional = nullptr);