doc: add example showing array-based fields

This commit is contained in:
Thomas Gelf 2016-05-20 01:24:01 +02:00
parent f0ccd28d3d
commit e1c05e5a3a
8 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,13 @@
Working with custom variables
=============================
Icinga Director allows you to work with custom variables in a very
powerful way. It implements the concept of `Data fields`. If you want
your users to be able to fill specific custom variables, you need to
add corresponding `fields` to
Examples
--------
* Add fields for existing commands
* Allow to fill an [array of interfaces](14-Fields-example-interfaces-array.md)

View File

@ -0,0 +1,31 @@
<a id="Fields-example-interfaces-array"></a>Working with fields - interfaces array example
==============================================
This example wants to show you how to make use of the `Array` data type
when creating fields for custom variables. First, please got to the `Dashboard`
and choose the `Define data fields` dashlet:
![Dashboard - Define data fields](screenshot/director/14_fields-for-interfaces/141_define_datafields.png)
Then create a new data field and select `Array` as it's data type:
![Define data field - Array](screenshot/director/14_fields-for-interfaces/142_add_datafield.png)
Then create a new `Host template` (or use an existing one):
![Define host template](screenshot/director/14_fields-for-interfaces/143_add_host_template.png)
Now add your formerly created data field to your template:
![Add field to template](screenshot/director/14_fields-for-interfaces/144_add_template_field.png)
That's it, now you are ready to create your first corresponding host. Once
you add your formerly created template, a new form field for your custom
variable will show up:
![Create host with given field](screenshot/director/14_fields-for-interfaces/145_create_host.png)
Have a look at the config preview, it will show you how your `Array`-based
custom variable will look like once deployed:
![Host config preview with Array](screenshot/director/14_fields-for-interfaces/146_config_preview.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB