r.sander
(Robert Sander)
January 14, 2025, 10:18am
1
Hi,
Is there a repo where we can have a look at the spec file for the REST API for each Checkmk version?
This would enable us to know which API endpoints (and their arguments) are available in which Checkmk version.
StefanM
(StefanM)
January 14, 2025, 11:55am
2
Hello Robert,
+1 from me
But the specification is calculated inside the instance:
committed 03:53PM - 21 Feb 24 UTC
The specification of the REST API defines the structure of the API. It is
comput… ed 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
CMK-15981
Change-Id: Ic524bf8146640c66919fd49653b805c981f47771
I copy the ~/var/check_mk/rest_api/spec/swagger-ui.spec from each version and parse it when needed. My parser outputs everything in a (for me) readable way in console:
Grepping for “Method:” returns all valid endpoints then:
3 Likes
system
(system)
Closed
January 14, 2026, 11:55am
3
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.