982 Commits

Author SHA1 Message Date
Thomas Gelf
1f660b514a IcingaServiceForm: allow empty name for apply rule 2016-10-22 06:09:10 +00:00
Thomas Gelf
5b4e7509f4 Just a couple of phpcs complaints fixed 2016-10-22 06:08:52 +00:00
Corentin Ardeois
3e30d34098 Use config variable in apply for rules
* use `config` instead of `value` in apply for rules
* update documentation

refs #11976
2016-10-22 06:07:57 +00:00
Corentin Ardeois
e7bd4343b5 Add support for Apply for rules in services
Apply for rules are defined through `apply_for` property
Only Array custom variables will be eligible in apply_for dropdown.

API Example:
```bash
 ./director-curl POST director/service?name=my_service '{"apply_for": "for (checked_tcp_port in host.vars.checked_tcp_ports)" }'
 ```

 Will render as:
 ```
  apply Service "my_service" for (checked_tcp_port in host.vars.checked_tcp_ports) {
      ...
  }
  ```
Feature: https://dev.icinga.org/issues/11976

Depends-On: https://github.com/Icinga/icingaweb2-module-director/pull/20
refs #11976
2016-10-22 06:00:54 +00:00
Thomas Gelf
b7eaab715b Make explicit calls to renderStringWithVariables 2016-10-22 05:48:09 +00:00
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
Thomas Gelf
a9b3b2f47a IcingaObjectImports: fix compatibility issue
fixes #12951
2016-10-20 19:17:52 +00:00
Thomas Gelf
fc2890d865 IcingaObject: new helper method for single...
...resolved custom vars
2016-10-20 01:37:23 +00:00
Thomas Gelf
76936c7efb IcingaTemplateResolver: fix resolver for unstored...
...objects

refs #12938
2016-10-20 01:32:52 +00:00
Thomas Gelf
98708e6496 Forms: better error handling
fixes #12926
2016-10-14 13:35:30 +00:00
Thomas Gelf
2df7144240 TemplateResolver: no more false alarms...
...when multiple paths lead to the same template

refs #11803
2016-10-14 11:26:41 +00:00
Thomas Gelf
558ea82203 IcingaRelatedObject: fix syntax, add comment...
...stating that this is unfinished
2016-10-14 10:40:29 +00:00
Thomas Gelf
cfbf40147c IcingaObjectImports: simplify code 2016-10-14 10:33:46 +00:00
Thomas Gelf
041fd52174 FieldLoader, TemplateResolver: more cleanup
A few fixes related to modified imports for unstored objects

refs #12922
2016-10-14 09:59:08 +00:00
Thomas Gelf
98acba9fb4 IcingaTemplateResolver: more tweaking
refs #12922
2016-10-14 09:40:01 +00:00
Thomas Gelf
61f3ffff7e TemplateResolver: deal with unstored modified...
...imports property

fixes #12922
2016-10-14 09:12:05 +00:00
Thomas Gelf
913c2687b6 IcingaObjectFieldLoader: first implementation
Should already replace all former functionality

refs #12904
2016-10-13 21:25:03 +00:00
Thomas Gelf
0d930efb46 IcingaObject: add new resolving helper methods
This for example allows to get a single inherited var and their origin
2016-10-13 21:25:03 +00:00
Thomas Gelf
cf4dccc817 Notification: add fields support
fixes #12642
2016-10-13 14:34:25 +00:00
Thomas Gelf
c1afda4392 IcingaObject: do not fail when rendering objects...
...without imports support

fixes #12618
2016-10-13 11:11:35 +00:00
Thomas Gelf
e99568fffc DirectorObjectForm: add unique error message...
...without adding an error in case we detect a loop. Also improve
resolve cache invalidation and clean up old imports-related code

refs #11803
2016-10-12 15:23:54 +00:00
Thomas Gelf
05f991c585 IcingaObject: no loop detection on unstored...
...objects

refs #11803
2016-10-12 14:26:44 +00:00
Thomas Gelf
7993724dcb IcingaTemplateResolver: detect and throw nesting..
...errors

fixes #11803
2016-10-12 14:16:19 +00:00
Thomas Gelf
0a26b94e7c IcingaObjectMultiRelations: fix service relations
...for sets
2016-10-12 09:11:05 +00:00
Thomas Gelf
34ed3da3b8 IcingaObject: remove duplicated short name logic 2016-10-12 09:09:28 +00:00
Thomas Gelf
c044de89de SyncPropertyForm: allow to sync m:n relations 2016-10-12 08:59:42 +00:00
Thomas Gelf
9e1cea0119 IcingaObject: fix v1 rendering for some properties
Mostly relations, no timeout, still ugly
2016-10-12 08:31:22 +00:00
Thomas Gelf
e096ec9ec5 IcingaServiceSets: allow to set imports 2016-10-12 08:30:10 +00:00
Thomas Gelf
f2f04c44e8 ServiceSet: add CLI command, fix key 2016-10-12 07:31:00 +00:00
Thomas Gelf
b7018627a0 IcingaServiceSet: introduce a new object type 2016-10-12 07:19:02 +00:00
Thomas Gelf
c4da25ef25 IcingaCommandArgument: render set_if without format
Icinga DSL support was introduced in 348cb1aa6 and works fine, but breaks
rendering of legacy arguments with set_if_format = NULL. This should default
to 'string', as we should IMO not force NOT NULL in the DB in this case.

refs #12153
fixes #12886
2016-10-11 09:45:11 +00:00
Markus Frosch
df36071c9c IcingaService: single objects should respect...
...their host's zone where not overriden by a service template

fixes #11988
2016-10-10 10:57:24 +00:00
Thomas Gelf
38eaf4036b IcingaHost: agent-related hint for legacy config 2016-10-09 13:27:38 +00:00
Thomas Gelf
e96db8b296 IcingaObject: move duplicate logic to common func 2016-10-09 13:15:05 +00:00
Thomas Gelf
cf063180d2 IcingaObject: start to dry out relation-related...
...code. Still weird and hard to understand because of lazy-loading,
can only get better. All this is required to be able to render objects
having obsolete dependencies in our activity log
2016-10-09 12:48:13 +00:00
Thomas Gelf
6f12663756 PrefetchCache: lot's of improvements
This commit enables the prefetch cache per default when rendering configs
and adds the following features:

* prefetch all kinds of Icinga object inheritance (imports)
* prefetch group memberships
* prefetch custom variables
* render vars with the same checksum only once

Roughly measured performance boost with a large real-life config, renders three
times faster as it did before. Might be even more for those suffering from high
latencies when accessing their DB remotely and/or on a slow storage.

fixes #12876
2016-10-09 12:41:06 +00:00
Thomas Gelf
c0a8c49d4f show/activitylog: fallback rendering for hosts...
...with obsolete parents, that have been removed in the meantime
2016-10-06 16:29:50 +00:00
Thomas Gelf
749f035971 Db/IcingaObject: formatting & style 2016-10-05 18:05:59 +00:00
Thomas Gelf
d1b7083145 IcingaObject: add helper methods for relations 2016-10-05 17:58:48 +00:00
Thomas Gelf
e9a570e96d Sync: fix sync & purge for datalistEntry objects 2016-10-05 17:45:25 +00:00
Marc DeTrano
348cb1aa63 IcingaCommandArgument: allow expressions in set_if
fixes #12153
2016-09-23 15:18:58 +00:00
Thomas Gelf
3383b97e69 IcingaRelatedObject: new helper class 2016-09-16 21:56:35 +00:00
Thomas Gelf
42212661f2 IcingaObject: document 'supports' vars and methods 2016-09-15 18:53:09 +00:00
Thomas Gelf
407a387dab DirectorDatalistEntry: add shouldBeRemoved...
...fixes sync for DatalistEntries

fixes #12715
2016-09-12 21:41:15 +00:00
Thomas Gelf
f52cd5ea77 DirectorDatafield: simplify usage 2016-09-09 21:32:26 +00:00
Thomas Gelf
217fb38517 IcingaObject: implement supportsAssignRules 2016-09-09 09:06:31 +00:00
Markus Frosch
a90595a004 IcingaHostGroup: Add apply statements 2016-09-09 08:32:42 +00:00
Thomas Gelf
2c7c54a15d IcingaConfig: improve override constant usage 2016-09-08 20:24:54 +00:00
Thomas Gelf
b2b189c425 IcingaServiceForm: support use_var_overrides...
...even for single host-assigned services
2016-09-08 18:43:25 +00:00
Thomas Gelf
b47c7be3d5 IcingaService: add use_var_overrides 2016-09-08 15:01:19 +00:00