https://github.com/1and1/checkmk-java-client
Java REST client for the Checkmk monitoring
https://github.com/1and1/checkmk-java-client
checkmk client java library maven okhttp3 openapi rest rest-client
Last synced: about 1 month ago
JSON representation
Java REST client for the Checkmk monitoring
- Host: GitHub
- URL: https://github.com/1and1/checkmk-java-client
- Owner: 1and1
- License: gpl-2.0
- Created: 2022-12-12T17:02:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T01:01:06.000Z (almost 2 years ago)
- Last Synced: 2024-04-19T22:49:04.603Z (almost 2 years ago)
- Topics: checkmk, client, java, library, maven, okhttp3, openapi, rest, rest-client
- Language: Shell
- Homepage:
- Size: 369 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CheckMK Java Client
[](https://github.com/1and1/checkmk-java-client/actions/workflows/generate.yaml)
[](https://maven-badges.herokuapp.com/maven-central/com.oneandone/checkmk-java-client)
[](https://javadoc.io/doc/com.oneandone/checkmk-java-client)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
A Java REST API library that connects to a [CheckMK](https://github.com/tribe29/checkmk) monitoring system server.
## What's inside
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](https://github.com/OpenAPITools/openapi-generator)
with the target language being Java, the HTTP client being okhttp
and bean validation turned on.
## Documentation
The Java API documentation can be browsed on [Javadoc.io](https://javadoc.io/doc/com.oneandone/checkmk-java-client).
The REST API documentation can be browsed in your local Checkmk installation.
## Using the client in your code
### Maven artifact
The client is provided as a Maven artifact. By adding this dependency to your POM,
you'll be able to use the client:
```xml
com.oneandone
checkmk-java-client
$THE_VERSION_TO_USE
```
For the appropriate version, please see the ["Version numbers"](#version-numbers) section below
and see [Maven Central](https://search.maven.org/search?q=g:com.oneandone%20AND%20a:checkmk-java-client)
versions.
### Demo code
A simple API client showing the [Checkmk version information](demo/src/main/java/com/ionos/network/checkmk/demo/Main.java)
is in the demo project.
It uses a custom [ApiClient](demo/src/main/java/com/ionos/network/checkmk/demo/CustomApiClient.java)
to overcome a problem in sending the Accept header.
## Generating the client code
The client code can be generated with
```bash
~ ./generate.sh
```
## Version numbers
Version numbers are composed of two parts:
1. First two segments: The generator script version.
2. 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, and
* `2.1.0.17` referencing to the Checkmk API `2.1.0p17`.
## Changes compared to the generated client
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](https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/)-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.
## License
This repository is licensed under the [GPL 2.0](LICENSE) license.