hetznerdns-java

Java implementation for the Hetzner DNS API

License

License

Categories

Categories

Java Languages
GroupId

GroupId

io.pelle.hetzner
ArtifactId

ArtifactId

hetznerdns-java
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

hetznerdns-java
Java implementation for the Hetzner DNS API
Project URL

Project URL

https://github.com/pellepelster/hetznerdns-java
Source Code Management

Source Code Management

https://github.com/pellepelster/hetznerdns-java

Download hetznerdns-java

How to add to project

<!-- https://jarcasting.com/artifacts/io.pelle.hetzner/hetznerdns-java/ -->
<dependency>
    <groupId>io.pelle.hetzner</groupId>
    <artifactId>hetznerdns-java</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.pelle.hetzner/hetznerdns-java/
implementation 'io.pelle.hetzner:hetznerdns-java:0.1.0'
// https://jarcasting.com/artifacts/io.pelle.hetzner/hetznerdns-java/
implementation ("io.pelle.hetzner:hetznerdns-java:0.1.0")
'io.pelle.hetzner:hetznerdns-java:jar:0.1.0'
<dependency org="io.pelle.hetzner" name="hetznerdns-java" rev="0.1.0">
  <artifact name="hetznerdns-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.pelle.hetzner', module='hetznerdns-java', version='0.1.0')
)
libraryDependencies += "io.pelle.hetzner" % "hetznerdns-java" % "0.1.0"
[io.pelle.hetzner/hetznerdns-java "0.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.springframework : spring-web jar 5.1.9.RELEASE
com.fasterxml.jackson.core : jackson-databind jar 2.9.10.4
org.projectlombok : lombok jar 1.18.8
org.slf4j : slf4j-api jar 1.7.25

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
com.github.tomakehurst : wiremock-jre8 jar 2.26.3
org.hamcrest : hamcrest jar 2.2

Project Modules

There are no modules declared in this project.

Hetzner DNS API

Java implementation of the Hetzner DNS API

Usage

Add dependency to you Maven/Gradle project


var dnsApi = new HetznerDnsAPI("${API_TOKEN}");

dnsApi.createZone(ZoneRequest.builder()
    .name("my-domain.de").build());

var zone = dnsApi.searchZone("my-domain.de");

dnsApi.updateZone(
        zone.getId(), ZoneRequest.builder()
        .name("my-domain.de").ttl(66).build());

var record = dnsApi.createRecord(
    RecordRequest.builder()
        .name("www")
        .zoneId(zone..getId())
        .type(RecordType.A)
        .value("1.1.1.1")
        .build());

dnsApi.updateRecord(
    record.getId(),
    RecordRequest.builder()
        .name("www")
        .zoneId(zone.get().getId())
        .type(RecordType.A)
        .value("8.8.8.8")
        .build());

Development

Run Integration Tests

The majority of the test coverage comes from a integration test against the real API. This can be started with

` INTEGRATION_TEST_API_TOKEN=${HETZNER_API_TOKEN} ./gradlew check

Versions

Version
0.1.0