mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
parent
92364d7b73
commit
380b1275b7
@ -49,21 +49,22 @@ bool ActionsHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& reques
|
|||||||
|
|
||||||
QueryDescription qd;
|
QueryDescription qd;
|
||||||
|
|
||||||
BOOST_FOREACH(const String& typeName, action->GetTypes()) {
|
Dictionary::Ptr params = HttpUtility::FetchRequestParameters(request);
|
||||||
if (typeName.IsEmpty())
|
|
||||||
break;
|
const std::vector<String>& types = action->GetTypes();
|
||||||
|
std::vector<ConfigObject::Ptr> objs;
|
||||||
|
|
||||||
|
if (!types.empty()) {
|
||||||
|
BOOST_FOREACH(const String& typeName, types) {
|
||||||
Type::Ptr type = Type::GetByName(typeName);
|
Type::Ptr type = Type::GetByName(typeName);
|
||||||
ASSERT(type);
|
ASSERT(type);
|
||||||
qd.Types.insert(type);
|
qd.Types.insert(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary::Ptr params = HttpUtility::FetchRequestParameters(request);
|
|
||||||
std::vector<ConfigObject::Ptr> objs;
|
|
||||||
|
|
||||||
if (!qd.Types.empty())
|
|
||||||
objs = FilterUtility::GetFilterTargets(qd, params);
|
objs = FilterUtility::GetFilterTargets(qd, params);
|
||||||
else
|
} else
|
||||||
objs.push_back(NULL);
|
objs.push_back(ConfigObject::Ptr());
|
||||||
|
|
||||||
Array::Ptr results = new Array();
|
Array::Ptr results = new Array();
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ public:
|
|||||||
boost::algorithm::replace_all(registerName, "_", "-"); \
|
boost::algorithm::replace_all(registerName, "_", "-"); \
|
||||||
std::vector<String> registerTypes; \
|
std::vector<String> registerTypes; \
|
||||||
String typeNames = types; \
|
String typeNames = types; \
|
||||||
|
if (!typeNames.IsEmpty()) \
|
||||||
boost::algorithm::split(registerTypes, typeNames, boost::is_any_of(";")); \
|
boost::algorithm::split(registerTypes, typeNames, boost::is_any_of(";")); \
|
||||||
ApiAction::Ptr action = new ApiAction(registerTypes, callback); \
|
ApiAction::Ptr action = new ApiAction(registerTypes, callback); \
|
||||||
ApiActionRegistry::GetInstance()->Register(registerName, action); \
|
ApiActionRegistry::GetInstance()->Register(registerName, action); \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user