POST /firewalls
Create a Firewall.
Error Codes specific to this Call
Code | Description |
---|---|
server_already_added | Server applied more than once |
incompatible_network_type | The resources network type is not supported by Firewalls |
firewall_resource_not_found | The resource the Firewall should be attached to was not found |
Servers
- https://api.hetzner.cloud/v1
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
rules[] |
Array | No |
Array of rules. Rules are limited to 50 entries per Firewall and 500 effective rules. |
rules[].port |
String | No |
Port or port range to apply the rule for. Only applicable for protocols A port range can be specified by separating lower and upper bounds with a dash. |
rules[].description |
String | No |
Description of the rule. |
rules[].direction |
String | Yes |
Traffic direction in which the rule should be applied to. Use Possible values:
|
rules[].destination_ips[] |
Array | No |
List of permitted IPv4/IPv6 addresses for outgoing traffic. The IPs must be in CIDR block notation. You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts.
For example, a network could be defined with Use |
rules[].protocol |
String | Yes |
Network protocol to apply the rule for. Possible values:
|
rules[].source_ips[] |
Array | No |
List of permitted IPv4/IPv6 addresses for incoming traffic. The IPs must be provided in CIDR block notation. You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts.
For example, a network could be defined with Use |
name |
String | Yes |
Name of the Firewall. Limited to a maximum of 128 characters. Must be unique per Project. |
labels |
Object | No |
User-defined labels ( |
apply_to[] |
Array | No |
Resources to apply the Firewall to. Resources added directly are taking precedence over those added via a Label Selector. |
apply_to[].label_selector |
Object | No |
Label Selector the Firewall is applied to. Only set for |
apply_to[].label_selector.selector |
String | Yes |
The selector. |
apply_to[].type |
String | Yes |
Type of the resource. Possible values:
|
apply_to[].server |
Object | No |
Server the Firewall is applied to. Only set for |
apply_to[].server.id |
Integer | Yes |
ID of the Server. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.