Add a get_changes function to the web API

Hi,

We plan to be using Terraform to add folders and hosts to Check_MK. These API functions work fine.

Presently there is an activate_changes API call. I’d like to be able to do this via Terraform too, however Terraform will need to know if activation is actually required to maintain a consistent state.

Would it be possible to add a “get_changes” API call which returns a list (or even just a count) of pending changes, so that applications interfacing with Check_MK will know if a call to activate_changes is actually required?

Cheers,
Rich

Hi Rich,
thanks!
we are currently working on a complete new REST API and will definitely consider this for that one.
Whether, we will add something to the current API regarding your request, we can’t state yet.
Best, Martin

1 Like

Thanks Martin! Please can you confirm if the new API will still have the ability to use pure JSON (not Python syntax)? This is essential for non-python things like Terraform :slight_smile:

Cheers,
Rich

Hi Rich,

The current API cannot be used with pure JSON in all aspects. Some actions need tuple params, which are not known to JSON.
If the Rest API will be usable with JSON only cannot be guaranteed.

BR,
Marcel

1 Like

Thanks Marcel. As long as the current JSON functionality is not reduced further we should be able to work around it.

Cheers,
Rich

It would be a blessing if it was all json. This would make it so much easer with example ansible.

How did you get around it?

I’m trying to use ansible, to add multiple service ruleset. For automation purposes.

I didn’t get around it as such - I just ended up using only those parts of the API that are pure JSON (which works for basic hosts and folders functionality).

I sincerely hope the new REST API will not be python-only.

1 Like