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

Method GetConfigFields

lib/db_ido/userdbobject.cpp:22–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{ }
21
22Dictionary::Ptr UserDbObject::GetConfigFields() const
23{
24 User::Ptr user = static_pointer_cast<User>(GetObject());
25
26 int typeFilter = user->GetTypeFilter();
27 int stateFilter = user->GetStateFilter();
28
29 return new Dictionary({
30 { "alias", user->GetDisplayName() },
31 { "email_address", user->GetEmail() },
32 { "pager_address", user->GetPager() },
33 { "host_timeperiod_object_id", user->GetPeriod() },
34 { "service_timeperiod_object_id", user->GetPeriod() },
35 { "host_notifications_enabled", user->GetEnableNotifications() },
36 { "service_notifications_enabled", user->GetEnableNotifications() },
37 { "can_submit_commands", 1 },
38 { "notify_service_recovery", (typeFilter & NotificationRecovery) ? 1 : 0 },
39 { "notify_service_warning", (stateFilter & StateFilterWarning) ? 1 : 0 },
40 { "notify_service_unknown", (stateFilter & StateFilterUnknown) ? 1 : 0 },
41 { "notify_service_critical", (stateFilter & StateFilterCritical) ? 1 : 0 },
42 { "notify_service_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 },
43 { "notify_service_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 },
44 { "notify_host_recovery", (typeFilter & NotificationRecovery) ? 1 : 0 },
45 { "notify_host_down", (stateFilter & StateFilterDown) ? 1 : 0 },
46 { "notify_host_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 },
47 { "notify_host_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 }
48 });
49}
50
51Dictionary::Ptr UserDbObject::GetStatusFields() const
52{

Callers

nothing calls this directly

Calls 1

GetPeriodMethod · 0.45

Tested by

no test coverage detected