Downtime on multiple hosts via url or REST API

So far we had no group that could not be predefined. But if the groups are only known at runtime and cannot be meaningfully predefined, such as “all Linux servers at location x” or "all servers with tag/label me2, then you probably have no other choice than to call the API for each host individually (You could parallelise the API calls to a certain extent).

Please keep in mind that the Web API no longer exists as of 2.2. With the host_by_query option in the REST-API it should be possible to pass an adhoc group of hosts:

A query expression of the Livestatus ‘hosts’ table in nested dictionary form. If you want to use multiple expressions, nest them with the AND/OR operators.

query={"op": "or", "expr": [{"op": "=", "left": "host_name", "right": "host1"}, {"op": "=", "left": "host_name", "right": "host2"}]}