NAME

WWW::Hetzner::Cloud::API::Firewalls - Hetzner Cloud Firewalls API

VERSION

version 0.001

SYNOPSIS

my $cloud = WWW::Hetzner::Cloud->new(token => $token);

# List firewalls
my $firewalls = $cloud->firewalls->list;

# Create firewall with rules
my $fw = $cloud->firewalls->create(
    name  => 'web-firewall',
    rules => [
        {
            direction   => 'in',
            protocol    => 'tcp',
            port        => '22',
            source_ips  => ['0.0.0.0/0', '::/0'],
        },
        {
            direction   => 'in',
            protocol    => 'tcp',
            port        => '80',
            source_ips  => ['0.0.0.0/0', '::/0'],
        },
    ],
);

# Apply to server
$cloud->firewalls->apply_to_resources($fw->id,
    { type => 'server', server => { id => 123 } },
);

# Delete
$cloud->firewalls->delete($fw->id);

NAME

WWW::Hetzner::Cloud::API::Firewalls - Hetzner Cloud Firewalls API

METHODS

list(%params)

Returns arrayref of Firewall objects.

get($id)

Returns Firewall object.

create(%params)

Creates firewall. Required: name. Optional: rules, labels, apply_to.

update($id, %params)

Updates firewall. Params: name, labels.

delete($id)

Deletes firewall.

set_rules($id, @rules)

Set firewall rules.

apply_to_resources($id, @resources)

Apply firewall to resources.

remove_from_resources($id, @resources)

Remove firewall from resources.

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.