Skip to content

litetex-oss/hetzner-cloud-client

Repository files navigation

Latest version Build Quality Gate Status

hetzner-cloud-client

A Java client for the Hetzner Cloud API

Usage

Example: Create a firewall and a server

HetznerCloudAPI api = new HetznerCloudAPI("API-TOKEN");

Firewall firewall = api.firewalls().create(b -> b
        .name("allow-icmp-from-everywhere")
        .firewallRule(r -> r
            .direction(FirewallRule.Direction.IN)
            .protocol(FirewallRule.Protocol.ICMP)
            .sourceIP("0.0.0.0/0")
            .sourceIP("::/0")))
    .firewall();

Server server = api.servers().create(b -> b
        .name("my-server")
        .startAfterCreate(false)
        .serverType("cax11")
        .image("...")
        .datacenter("...")
        .firewall(firewall.id()))
    .server();

Installation

Installation guide for the latest release

Contributing

See the contributing guide for detailed instructions on how to get started with our project.

Dependencies and Licenses

View the license of the current project or the summary including all dependencies