Open mskrgulja opened 2 years ago
The working solution, for me was to set $resolveIds = true. Here is the patch if somebody needs it:
*** /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php
--- /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php
***************
*** 2845,2851 ****
$skipDefaults = false,
array $chosenProperties = null,
$resolveIds = true,
! $keepId = false
) {
$props = [];
--- 2845,2851 ----
$skipDefaults = false,
array $chosenProperties = null,
$resolveIds = true,
! $keepId = true
) {
$props = [];
Expected Behavior
Get ID for each Service Apply Rule
for example: curl -k -s -S -i -u ':' -H 'Accept: application/json' 'https:/icingahost/icingaweb2/director/ServiceApplyRules' should return all service apply rules with internal ID's
Per official documentation https://icinga.com/docs/icinga-director/latest/doc/70-REST-API/#service-apply-rules this should be possible:
Current Behavior
The service apply rules are fetched but without internal ID. Example response:
{ "assign_filter": "host.vars.metricbeat_host=true", "check_command": "check_beat_stats", "fields": [], "imports": [ "basic-service" ], "object_name": "metricbeat Stats", "object_type": "apply", "vars": { "beat_file_handles_percent_critical": "0:90", "beat_file_handles_percent_warn": "0:85", "beat_host": "$host.vars.metricbeat_host$", "beat_module_errors_percent_critical": "0:10", "beat_module_errors_percent_warn": "0:1", "beat_output_errors_percent_critical": "0:10", "beat_output_errors_percent_warn": "0:1", "beat_pipeline_errors_absolute_warn": "0:0", "beat_pipeline_errors_percent_critical": "0:10", "beat_port": 20860 }
There is no IDSteps to Reproduce (for bugs)
Make a request to the API endpoint
director/serviceapplyrules
Your Environment
icinga2 --version
): r2.13.5-1