From 47479ac4de245048bb0b937a83d9aceac28815ae Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 23 Feb 2015 13:56:53 +0100 Subject: [PATCH] Implement the 'get_time_period' function refs #8467 --- doc/17-library-reference.md | 9 +++++++++ lib/icinga/objectutils.cpp | 1 + 2 files changed, 10 insertions(+) diff --git a/doc/17-library-reference.md b/doc/17-library-reference.md index 82e54e2a7..aca1c767e 100644 --- a/doc/17-library-reference.md +++ b/doc/17-library-reference.md @@ -99,6 +99,15 @@ Signature: Returns the UserGroup object with the specified name, or `null` if no such UserGroup object exists. +### get_time_period + +Signature: + + function get_time_period(name); + +Returns the TimePeriod object with the specified name, or `null` if no such TimePeriod object exists. + + ### get_object Signature: diff --git a/lib/icinga/objectutils.cpp b/lib/icinga/objectutils.cpp index 844dc2b93..a10baeeeb 100644 --- a/lib/icinga/objectutils.cpp +++ b/lib/icinga/objectutils.cpp @@ -38,6 +38,7 @@ REGISTER_SCRIPTFUNCTION(get_notification_command, &NotificationCommand::GetByNam REGISTER_SCRIPTFUNCTION(get_host_group, &HostGroup::GetByName); REGISTER_SCRIPTFUNCTION(get_service_group, &ServiceGroup::GetByName); REGISTER_SCRIPTFUNCTION(get_user_group, &UserGroup::GetByName); +REGISTER_SCRIPTFUNCTION(get_time_period, &TimePeriod::GetByName); Service::Ptr ObjectUtils::GetService(const String& host, const String& name) {