Commit Graph

15 Commits

Author SHA1 Message Date
Corentin Ardeois ddcfb09f58 Handle expressions only for apply objects
Expressions will be handled only if the object is an ApplyRule.
Only properties and custom variables are replaced.

refs #11976
2016-10-22 00:15:09 +00:00
Corentin Ardeois bcef87f4c9 Add support for expressions
Any rendered string can contain variables encapsulated with "$$" characters.

Example:
Display Name declared with `Port $$host.vars.tcp_port$$ check` will
be processed as `"Port " + host.vars.tcp_port + " check"`

API:
```bash
 ./director-curl POST director/service?name=my_service '{"display_name": "Port $$host.vars.tcp_port$$ check" }'
 ```

 Rendered config:
 ```
  apply Service "my_service" {
      import "my_template"

      display_name = "Port " + host.vars.tcp_port + " check"
  }
 ```

refs #11976
2016-10-22 00:15:09 +00:00
Thomas Gelf 4cd399e059 IcingaConfigHelper: use string-based sort for...
...dictionary fields to make PHP 5.x and PHP 7.x produce the same output.

refs #12591
2016-09-07 20:44:03 +00:00
Thomas Gelf 6427b22621 IcingaConfigHelper: fix numeric dictionary key...
...rendering and add related tests

fixes #12591
2016-08-30 12:15:48 +00:00
Thomas Gelf a80aed49a1 StateFilterTest: a couple of tests for state filters 2016-03-01 04:28:26 +01:00
Thomas Gelf 4b46330855 ExtensibleSet: do not quote values, adjust tests 2016-02-29 18:30:32 +01:00
Thomas Gelf 245e632f54 ExtensibleSet: fix tests 2016-02-29 17:37:01 +01:00
Thomas Gelf cc70193a56 ExtensibleSet: add and test renderer 2016-02-29 12:38:31 +01:00
Thomas Gelf 23dd4721ec ExtensibleSet: basic implementation & tests 2016-02-29 12:23:08 +01:00
Thomas Gelf 11e5ef0362 IcingaConfigHelper: empty intervals are null 2016-02-28 16:27:06 +01:00
Thomas Gelf 4dde0eaaf6 IcingaConfigHelper: Icinga2 doesn't support 2m 30s 2016-02-28 13:55:16 +01:00
Thomas Gelf 255acf2fd5 IcingaConfigHelperTest: add duration format tests 2016-02-28 13:25:49 +01:00
Thomas Gelf f2a1ec91f7 test/php: allow to skip tests with db-dependency 2016-02-26 12:01:00 +01:00
Thomas Gelf c32fe0a3bb AssignRendererTest: add more test cases 2016-02-25 20:11:39 +01:00
Thomas Gelf c741042108 AssignRendererTest: first new simple test 2016-02-25 18:24:17 +01:00