A Java REST API library that connects to a CheckMK monitoring system server.
This repository contains just scripts to build the client. It does not contain the source code that is being generated. Source code, library jar and Javadoc is on Maven Central.
The REST client is generated using the OpenAPI generator with the target language being Java, the HTTP client being okhttp and bean validation turned on.
The Java API documentation can be browsed on Javadoc.io.
The REST API documentation can be browsed in your local Checkmk installation.
The client is provided as a Maven artifact. By adding this dependency to your POM, you'll be able to use the client:
<groupId>com.oneandone</groupId>
<artifactId>checkmk-java-client</artifactId>
<version>$THE_VERSION_TO_USE</version>
For the appropriate version, please see the "Version numbers" section below and see Maven Central versions.
A simple API client showing the Checkmk version information is in the demo project. It uses a custom ApiClient to overcome a problem in sending the Accept header.
The client code can be generated with
~ ./generate.sh
Version numbers are composed of two parts:
- First two segments: The generator script version.
- Last segments: The Checkmk API version specification.
Example: Version 1.0.2.1.0.17
is composed of the parts
1.0
being the generator script version, and2.1.0.17
referencing to the Checkmk API2.1.0p17
.
There are multiple changes compared to the pure generated client. The generated client would not build because of certain shortcomings of OpenAPI generator.
- Replacement of AnyOf-based OpenAPI types with Java Map types. OpenAPI generator 5.4 does not natively support AnyOf-types.
- Fixing of syntactic errors, i.e. combination of
@NotNull
-annotation with type names (i.e.@NotNullString
instead of@NotNull String
). - Update of several depencency versions, i.e. okhttp and gson.
- Inclusion of the SonaType OSS artifact repository into the POM.
This repository is licensed under the GPL 2.0 license.