mirror of https://github.com/Icinga/icinga2.git
parent
74ef3e3ce6
commit
3473731034
|
@ -39,7 +39,7 @@ mkclass_target(usergroup.ti usergroup.tcpp usergroup.thpp)
|
||||||
mkclass_target(user.ti user.tcpp user.thpp)
|
mkclass_target(user.ti user.tcpp user.thpp)
|
||||||
|
|
||||||
set(icinga_SOURCES
|
set(icinga_SOURCES
|
||||||
api.cpp apiactions.cpp apievents.cpp checkable.cpp checkable.thpp checkable-dependency.cpp checkable-downtime.cpp checkable-event.cpp
|
apiactions.cpp apievents.cpp checkable.cpp checkable.thpp checkable-dependency.cpp checkable-downtime.cpp checkable-event.cpp
|
||||||
checkable-flapping.cpp checkcommand.cpp checkcommand.thpp checkresult.cpp checkresult.thpp
|
checkable-flapping.cpp checkcommand.cpp checkcommand.thpp checkresult.cpp checkresult.thpp
|
||||||
cib.cpp clusterevents.cpp command.cpp command.thpp comment.cpp comment.thpp compatutility.cpp dependency.cpp dependency.thpp
|
cib.cpp clusterevents.cpp command.cpp command.thpp comment.cpp comment.thpp compatutility.cpp dependency.cpp dependency.thpp
|
||||||
dependency-apply.cpp downtime.cpp downtime.thpp eventcommand.cpp eventcommand.thpp
|
dependency-apply.cpp downtime.cpp downtime.thpp eventcommand.cpp eventcommand.thpp
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/******************************************************************************
|
|
||||||
* Icinga 2 *
|
|
||||||
* Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org) *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or *
|
|
||||||
* modify it under the terms of the GNU General Public License *
|
|
||||||
* as published by the Free Software Foundation; either version 2 *
|
|
||||||
* of the License, or (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
* This program is distributed in the hope that it will be useful, *
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
||||||
* GNU General Public License for more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License *
|
|
||||||
* along with this program; if not, write to the Free Software Foundation *
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#include "icinga/api.hpp"
|
|
||||||
#include "remote/apifunction.hpp"
|
|
||||||
#include "base/logger.hpp"
|
|
||||||
|
|
||||||
using namespace icinga;
|
|
||||||
|
|
||||||
REGISTER_APIFUNCTION(GetAnswerToEverything, uapi, boost::bind(&API::GetAnswerToEverything, _2));
|
|
||||||
|
|
||||||
Value API::GetAnswerToEverything(const Dictionary::Ptr& params)
|
|
||||||
{
|
|
||||||
String text;
|
|
||||||
|
|
||||||
if (params)
|
|
||||||
text = params->Get("text");
|
|
||||||
|
|
||||||
Log(LogInformation, "API")
|
|
||||||
<< "Hello from the Icinga 2 API: " << text;
|
|
||||||
|
|
||||||
return 42;
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
/******************************************************************************
|
|
||||||
* Icinga 2 *
|
|
||||||
* Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org) *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or *
|
|
||||||
* modify it under the terms of the GNU General Public License *
|
|
||||||
* as published by the Free Software Foundation; either version 2 *
|
|
||||||
* of the License, or (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
* This program is distributed in the hope that it will be useful, *
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
||||||
* GNU General Public License for more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License *
|
|
||||||
* along with this program; if not, write to the Free Software Foundation *
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#ifndef API_H
|
|
||||||
#define API_H
|
|
||||||
|
|
||||||
#include "icinga/i2-icinga.hpp"
|
|
||||||
#include "base/value.hpp"
|
|
||||||
#include "base/dictionary.hpp"
|
|
||||||
|
|
||||||
namespace icinga
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup icinga
|
|
||||||
*/
|
|
||||||
class I2_ICINGA_API API
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static Value GetAnswerToEverything(const Dictionary::Ptr& params);
|
|
||||||
|
|
||||||
private:
|
|
||||||
API(void);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* API_H */
|
|
Loading…
Reference in New Issue