RestAPI Host Collections filter expressions

Hi all :)!

How would your/the filter expression look like if ($API_URL/domain-types/host/collections/all) the host should be:

  • currently not UP (state != 0)
  • not being acknowledged (acknowledged = 0)
  • not having any downtime set ???

I understood, that downtimes are logically connected to the host object via the downtime ID but is there any filter for the hosts? (I am currently not interested in any more details - just if a downtime is set).

Thx & br
Oliver

You can query list column “scheduled_downtime_depth” in the hosts table. If this entry is larger than 0 a downtime is currently set for the host.

1 Like

Many thanks !

For the sake of completeness (in my case):

{"op": "and", "expr": [{"op": "!=", "left": "state", "right": "0"}, {"op": "~", "left": "label_names", "right": "platform"}, {"op": "=", "left": "acknowledged", "right": "0"}, {"op": "!=", "left": "scheduled_downtime_depth", "right": "1"}]}

1 Like