[icinga-checkins] icinga.org: icinga2/master: Update documentation: Types, #include <>

git at icinga.org git at icinga.org
Tue Feb 5 15:31:35 CET 2013


Module: icinga2
Branch: master
Commit: 63db2bb89ac8ff07bfefd61e717fda506e7d8de5
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=63db2bb89ac8ff07bfefd61e717fda506e7d8de5

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue Feb  5 15:31:29 2013 +0100

Update documentation: Types, #include <>

Fixes #3624

---

 docs/icinga2-config.txt |   57 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/docs/icinga2-config.txt b/docs/icinga2-config.txt
index a0124d2..0c3d044 100644
--- a/docs/icinga2-config.txt
+++ b/docs/icinga2-config.txt
@@ -314,7 +314,18 @@ Example:
 #include "conf.d/*.conf"
 -------------------------------------------------------------------------------
 
-NOTE: Wildcard includes are not currently implemented.
+Icinga also supports include search paths similar to how they work in a
+C/C++ compiler:
+
+-------------------------------------------------------------------------------
+#include <itl/itl.conf>
+-------------------------------------------------------------------------------
+
+Note the use of angle brackets instead of double quotes. This causes the
+config compiler to search the include search paths for the specified file.
+By default $PREFIX/icinga2 is included in the list of search paths.
+
+Wildcards are not permitted when using angle brackets.
 
 Library directive
 ~~~~~~~~~~~~~~~~~
@@ -330,6 +341,50 @@ Example:
 
 NOTE: The "icinga" library is automatically loaded by Icinga.
 
+Type Definition
+~~~~~~~~~~~~~~~
+
+By default Icinga has no way of semantically verifying its configuration
+objects. This is where type definitions come in. Using type definitions you
+can specify which attributes are allowed in an object definition.
+
+Example:
+
+-------------------------------------------------------------------------------
+type Pizza {
+	number radius,
+
+	dictionary ingredients {
+		string *,
+
+		dictionary * {
+			number quantity,
+			string name
+		}
+	},
+
+	any custom::*
+}
+-------------------------------------------------------------------------------
+
+The Pizza definition provides the following validation rules:
+
+* Pizza objects may contain an attribute "radius" which has to be a number.
+* Pizza objects may contain an attribute "ingredients" which has to be a
+dictionary.
+* Elements in the ingredients dictionary can be either a string or a dictionary.
+* If they're a dictionary they may contain attributes "quantity" (of type
+number) and "name" (of type string).
+* Pizza objects may contain attribute matching the pattern "custom::*" of any
+type.
+
+Valid types for type rules include:
+* any
+* number
+* string
+* scalar (an alias for string)
+* dictionary
+
 Configuration Objects
 ---------------------
 





More information about the icinga-checkins mailing list