Have the REST-API return all Downtimes of a host including services of that host in a single request
Currently there is no way to get or remove all downtimes of a host via the REST-API with a single command. You can only receive a host downtime or service downtimes. For service downtimes you have to know/query the API for all services on a host and then query for downtimes.
Please extend the REST-API to return/remove all downtimes on a host without me having to know which services are on the host and are currently in downtime
Comments: 3
-
19 Jul
Niklas PulinaHi Philipp, thanks for your suggestion.
To delete all downtimes from a given host, you can send a POST request to the endpoint /domain-types/downtime/actions/delete/invoke with the following payload (with HOSTNAME being replaced by the actual host name):
{
"delete_type": "query",
"query": {"op": "~", "left": "downtimes.host_name", "right": "HOSTNAME"}
}
Does that solve your problem? -
25 Jul
PhilippHi Niklas,
this does solve my problem. Thank you.
It would still be nice to be able to query all current active downtimes of a host with a single request. -
31 Jul
Niklas Pulina AdminHi Philipp, we are moving towards nudging users to set downtimes on hosts, not on individual services, as we have seen setting downtimes on services is prone to cause confusion for many users.
Therefore, we will not plan such an endpoint for the time being. Thank you for your understanding.