Java Client for the Hetzner Cloud API, as well as the new "Hetzner OneAPI"
https://sinuscosinustan.grebedoc.dev/hetznercloud-java/
- Java 100%
* **Tan Siewert**
* Migrate to Codeberg
*Released by Tan Siewert <tan@siewert.io>*
Signed-off-by: Tan Siewert <tan@siewert.io>
|
||
|---|---|---|
| .woodpecker | ||
| src | ||
| .gitignore | ||
| CHANGELOG.md | ||
| checkstyle.xml | ||
| LICENSE.md | ||
| pom.xml | ||
| README.md | ||
| renovate.json | ||
Hetzner Cloud API for Java
Simple Java client for the Hetzner Cloud API.
Compile
This project uses Maven as build automation.
Just run mvn clean install to install it in the local Maven repository cache.
How to use
Maven
Dependency:
<dependencies>
<dependency>
<groupId>io.github.sinuscosinustan</groupId>
<artifactId>hetznercloud-api</artifactId>
<version>5.0.3</version>
</dependency>
</dependencies>
Gradle
Put this in the build.gradle file of the project:
repositories {
mavenCentral()
}
dependencies {
implementation "io.github.sinuscosinustan:hetznercloud-api:5.0.3"
}
kotlin-dsl
dependencies {
implementation("io.github.sinuscosinustan:hetznercloud-api:5.0.3")
}
Requirements
- Java 17 or higher
- Maven 3.6.0 or higher
How to run tests
This project has unit tests, as well as integration tests.
Unit Tests (Default)
mvn test
Integration Tests
Integration tests require an API Token for the Hetzner Cloud. Set the API token as an environment variable called HCLOUD_TOKEN.
To obtain an API key, please see the official API documentation.
HCLOUD_TOKEN="${api_key}" mvn test -Pintegration-tests
Code Quality
Checkstyle
Checkstyle runs automatically during compilation:
mvn compile
Code Coverage (JaCoCo)
Generate code coverage reports:
mvn test
View the HTML report at target/site/jacoco/index.html
JavaDocs
The JavaDocs are available here
Dependencies
The following dependencies were used in this project:
- jackson-databind under Apache2.0 License
- Lombok under MIT License