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

Method GetService

lib/icinga/objectutils.cpp:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26REGISTER_FUNCTION(Icinga, get_time_period, &TimePeriod::GetByName, "name");
27
28Service::Ptr ObjectUtils::GetService(const Value& host, const String& name)
29{
30 Host::Ptr hostObj;
31
32 if (host.IsObjectType<Host>())
33 hostObj = host;
34 else
35 hostObj = Host::GetByName(host);
36
37 if (!hostObj)
38 return nullptr;
39
40 return hostObj->GetServiceByShortName(name);
41}
42
43Array::Ptr ObjectUtils::GetServices(const Value& host)
44{

Callers

nothing calls this directly

Calls 1

GetServiceByShortNameMethod · 0.80

Tested by

no test coverage detected