Get downtime_id by created a downtime

Is it possible to get the downtime_id back form the API when a downtime for a host is created?
And is there a possibility to update a existing downtime.

Currently the API does not return any value when successfully creating a host or service downtime.

This should be changed and the ID should be returned, @mschlenker.

Currently you have to search for the downtime right after creating it when you need the ID.

There is also currently no API endpoint to “update” a scheduled downtime.

Hi, in some cases (like in this particular one), requests to the REST API have to be forwarded to and processed by the monitoring core. At the moment however, our REST API only manages the preparation and dispatch of commands to Livestatus. These commands are then processed in an asynchronous manner, and the REST API does not (yet) validate the successful execution of commands on Livestatus. Therefore, at the moment, it is up to the user to check that the command has been executed correctly.

We have added the section “Queries through the REST API” to our documentation (accessible from inside Checkmk via Help > REST API documentation) which provides an example of how you could check the execution of such command yourself. This section is available in the latest patch versions of Checkmk 2.2. Please also find a screenshot of this section as follows:

We definitely understand your demand for a solution which is available directly via the REST API request though. However, as this would include a non-trivial enhancement of the underlying mechanism, I’d like to ask you for posting your request in our Ideas Portal – this allows other users to vote on the improvement and therefore enables us to understand the overall demand for this improvement among our users and prioritize it accordingly. Many thanks in advance!

Your second request (updating existing downtimes) has already been implemented though. :slight_smile: For details, please see Werk #16579.

1 Like