Werk #15724: Change API specification computation

Component REST API
Title Change API specification computation
Date Feb 17, 2024
Checkmk Edition Checkmk Raw (CRE)
Checkmk Version 2.3.0b1 2.4.0b1
Level Prominent Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed

The specification of the REST API defines the structure of the API. It is computed automatically from the implementation in Checkmk.

Previously the specification was computed during runtime when something requested access to the specification. This could be a user opening ReDoc or the Swagger UI. The specification was then computed ad-hoc and cached in the memory of the apache process. This caused several issues:

  • After spawning a new apache, the specification needed to be recomputed for every process. This caused a delay in the first request hitting an apache process asking for it.
  • It was held in memory by every process consuming a few MB.
  • The invalidation of the cache and computation of new specification could not be triggered manually.

With this change the specification is now stored in the site and made available to all apache processes from there.

With the dedicated command cmk-compute-api-spec the computation can now be triggered in specific situations automatically or manually for debugging.

The specification is now updated in these situations:

  • post-create hook: Create the initial spec after a site has been created
  • post rename action: Update the spec after a site has been copied, restored or renamed
  • update-config action: Update the spec after the site has been updated

To the list of all Werks