From: Gunnar Beutner Date: Tue, 10 Feb 2015 14:21:48 +0000 (+0100) Subject: Add documentation for the object accessor functions X-Git-Tag: v2.3.0~242 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f3975005e342a2ac5821ae0f650f40c8802512f;p=icinga2 Add documentation for the object accessor functions refs #7564 --- diff --git a/doc/16-library-reference.md b/doc/16-library-reference.md index 2130eab07..82e54e2a7 100644 --- a/doc/16-library-reference.md +++ b/doc/16-library-reference.md @@ -19,6 +19,106 @@ log(severity, facility, value) | Writes a message to the log. `severity` can be typeof(value) | Returns the type object for a value. exit(integer) | Terminates the application. +## Object Accessor Functions + +These functions can be used to retrieve a reference to another object by name. + +### get_check_command + +Signature: + + function get_check_command(name); + +Returns the CheckCommand object with the specified name, or `null` if no such CheckCommand object exists. + +### get_event_command + +Signature: + + function get_event_command(name); + +Returns the EventCommand object with the specified name, or `null` if no such EventCommand object exists. + +### get_notification_command + +Signature: + + function get_notification_command(name); + +Returns the NotificationCommand object with the specified name, or `null` if no such NotificationCommand object exists. + +### get_host + +Signature: + + function get_notification_command(name); + +Returns the Host object with the specified name, or `null` if no such Host object exists. + + +### get_service + +Signature: + + function get_service(host_name, service_name); + +Returns the Service object with the specified name, or `null` if no such Service object exists. + + +### get_user + +Signature: + + function get_user(name); + +Returns the User object with the specified name, or `null` if no such User object exists. + +### get_host_group + +Signature: + + function get_host_group(name); + +Returns the HostGroup object with the specified name, or `null` if no such HostGroup object exists. + + +### get_service_group + +Signature: + + function get_service_group(name); + +Returns the ServiceGroup object with the specified name, or `null` if no such ServiceGroup object exists. + +### get_user_group + +Signature: + + function get_user_group(name); + +Returns the UserGroup object with the specified name, or `null` if no such UserGroup object exists. + + +### get_object + +Signature: + + function get_object(type, name); + +Returns the object with the specified type and name, or `null` if no such object exists. `type` must refer +to a type object. + + +### get_objects + +Signature: + + function get_objects(type); + +Returns an array of objects whose type matches the specified type. `type` must refer +to a type object. + + ## Math object The global `Math` object can be used to access a number of mathematical constants