hetzner/firewalls

Types

FirewallSortOption = enum
  sortId = "id", sortIdAsc = "id:asc", sortIdDesc = "id:desc",
  sortName = "name", sortNameAsc = "name:asc", sortNameDesc = "name:desc",
  sortCreated = "created", sortCreatedAsc = "created:asc",
  sortCreatedDesc = "created:desc"

Procs

proc deleteFirewallsId(client: HetznerClient; id: int64): Future[AsyncResponse] {.
    ...stackTrace: false, raises: [Exception, ValueError, HttpRequestError,
                                LibraryError, SslError, OSError, IOError,
                                ProtocolError, KeyError],
    tags: [RootEffect, ReadIOEffect, TimeEffect], forbids: [].}
Deletes a Firewall.

Call specific error codes

CodeDescription
resource_in_useFirewall must not be in use to be deleted
proc getFirewalls(client: HetznerClient; sort: set[FirewallSortOption] = {};
                  name: string = default(string);
                  labelSelector: string = default(string)): Future[
    GetFirewallsResponse] {....stackTrace: false, raises: [Exception, ValueError,
    KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError,
    ProtocolError, OpenParserJsonError, HetznerClientError],
                            tags: [RootEffect, ReadIOEffect, TimeEffect],
                            forbids: [].}
Returns all Firewall objects.
proc getFirewallsId(client: HetznerClient; id: int64): Future[
    GetFirewallsIdResponse] {....stackTrace: false, raises: [Exception, ValueError,
    HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError,
    KeyError, OpenParserJsonError, HetznerClientError],
                              tags: [RootEffect, ReadIOEffect, TimeEffect],
                              forbids: [].}
Gets a specific Firewall object.
proc postFirewalls(client: HetznerClient; body: PostFirewallsRequest): Future[
    PostFirewallsResponse] {....stackTrace: false, raises: [Exception, ValueError,
    HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError,
    KeyError, OpenParserJsonError, HetznerClientError],
                             tags: [RootEffect, ReadIOEffect, TimeEffect],
                             forbids: [].}
Creates a new Firewall.

#### Call specific error codes

| Code                          | Description
|
|------------------------------
|-------------------------------------------------------------- |
| `server_already_added`        | Server added more than one time to resource
|
| `incompatible_network_type`   | The Network type is incompatible for the given
resource       |
| `firewall_resource_not_found` | The resource the Firewall should be attached
to was not found |
proc putFirewallsId(client: HetznerClient; id: int64;
                    body: PutFirewallsIdRequest): Future[PutFirewallsIdResponse] {.
    ...stackTrace: false, raises: [Exception, ValueError, HttpRequestError,
                                LibraryError, SslError, OSError, IOError,
                                ProtocolError, KeyError, OpenParserJsonError,
                                HetznerClientError],
    tags: [RootEffect, ReadIOEffect, TimeEffect], forbids: [].}

Updates the Firewall.

Note that when updating labels, the Firewall's current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

Note: if the Firewall object changes during the request, the response will be a โ€œconflictโ€ error.