Hello everyone,
I’m trying to create and manage ServiceSets in Icinga Director through Director API,
Unfortunately not all functions are documented and i need to make some extra research to find how i can work with each part of Director interface through API requests.
Currently i’m looking how to:
1. GET a list of all ServiceSets configured in Icinga2 Director
Example that works good for querying single ServiceSet:
curl -u awesomeuser:awesomepassword GET -H 'Accept: application/json' "https://awesomeicinga.example.com/icingaweb2/director/serviceset?name=positive_checks
{
"assign_filter": "host.groups=%22random%22",
"description": "Set of random checks for benchmarking",
"object_name": "positive_checks",
"object_type": "template"
}
The same try with bulk request:
curl -u awesomeuser:awesomepassword GET -H 'Accept: application/json' "https://awesomeicinga.example.com/icingaweb2/director/servicesets
{"status":"error","message":"Page not found."}
Currently services endpoint works in both bulk and single object query:
/icingaweb2/director/service?name=something
vs /icingaweb2/director/services
for bulk requests
I expected to get a bulk reply as it works with services
I’ve checked URL in Web UI, it points at /icingaweb2/director/services/sets
but
curl -u awesomeuser:awesomepassword GET -H 'Accept: application/json' "https://awesomeicinga.example.com/icingaweb2/director/services/sets
Doesn’t provide any output at all
2. GET a list of services in specified ServiceSet
/icingaweb2/director/serviceset/services?name=positive_checks
in Web UI points me to the list of services:
Unfortunately i’m not able to make the same call through API
3. Add/Remove service to/from ServiceSet
Also need help with those requests
Any advice is highly appreciated.
With best regards,
Dmitriy