MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetTargetByName

Method GetTargetByName

lib/remote/templatequeryhandler.cpp:51–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 }
50
51 Value GetTargetByName(const String& type, const String& name) const override
52 {
53 Type::Ptr ptype = Type::GetByName(type);
54
55 ConfigItem::Ptr item = ConfigItem::GetByTypeAndName(ptype, name);
56
57 if (!item || !item->IsAbstract())
58 BOOST_THROW_EXCEPTION(std::invalid_argument("Template does not exist."));
59
60 return GetTargetForTemplate(item);
61 }
62
63 bool IsValidType(const String& type) const override
64 {

Callers

nothing calls this directly

Calls 2

GetTargetForTemplateFunction · 0.85
IsAbstractMethod · 0.45

Tested by

no test coverage detected