NAME
WWW::Hetzner::Cloud - Perl client for Hetzner Cloud API
VERSION
version 0.001
SYNOPSIS
use WWW::Hetzner::Cloud;
my $cloud = WWW::Hetzner::Cloud->new(
token => $ENV{HETZNER_API_TOKEN},
);
# List servers
my $servers = $cloud->servers->list;
# Create server
my $server = $cloud->servers->create(
name => 'my-server',
server_type => 'cx23',
image => 'debian-13',
location => 'fsn1',
ssh_keys => ['my-key'],
);
# Delete server
$cloud->servers->delete($server->{id});
NAME
WWW::Hetzner::Cloud - Perl client for Hetzner Cloud API
RESOURCES
Compute
servers - Cloud servers (create, delete, power on/off, reboot, rebuild, rescue)
server_types - Available server types
images - OS images
ssh_keys - SSH keys
placement_groups - Placement groups for server distribution
Networking
networks - Private networks with subnets and routes
firewalls - Firewall rules and application
floating_ips - Reassignable public IPs
primary_ips - Primary IPs for servers
load_balancers - Load balancers with targets and services
Storage
volumes - Block storage volumes
DNS
zones - DNS zones and records
Security
certificates - TLS certificates (managed or uploaded)
Info
locations - Locations (fsn1, nbg1, hel1, ash, hil, sin)
datacenters - Datacenters
DNS EXAMPLE
# List DNS zones
my $zones = $cloud->zones->list;
# Create a zone
my $zone = $cloud->zones->create(name => 'example.com');
# Add DNS records
my $rrsets = $zone->rrsets;
$rrsets->add_a('www', '203.0.113.10');
$rrsets->add_cname('blog', 'www.example.com.');
$rrsets->add_mx('@', 'mail.example.com.', 10);
LOGGING
WWW::Hetzner::Cloud uses Log::Any for logging via WWW::Hetzner::Role::HTTP. This allows you to integrate with any logging framework of your choice.
Log Levels Used
debug - Request URLs, bodies, response status
info - Successful API calls (method, path, status)
error - API errors before croak
Enabling Logging
By default, logs are discarded. To see them, configure a Log::Any adapter:
# Simple: output to STDERR
use Log::Any::Adapter ('Stderr');
# With minimum level
use Log::Any::Adapter ('Stderr', log_level => 'debug');
# To a file
use Log::Any::Adapter ('File', '/var/log/hetzner.log');
# Integration with Log::Log4perl
use Log::Log4perl;
Log::Log4perl->init('log4perl.conf');
use Log::Any::Adapter ('Log4perl');
# Integration with Log::Dispatch
use Log::Dispatch;
my $dispatcher = Log::Dispatch->new(...);
use Log::Any::Adapter ('Dispatch', dispatcher => $dispatcher);
See Log::Any::Adapter for all available adapters.
SEE ALSO
WWW::Hetzner, WWW::Hetzner::Role::HTTP
SUPPORT
Source Code
The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)
https://github.com/Getty/p5-www-hetzner
git clone https://github.com/Getty/p5-www-hetzner.git
AUTHOR
Torsten Raudssus <torsten@raudssus.de>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.