POST /firewalls

Create a Firewall.

Error Codes specific to this Call

CodeDescription
server_already_addedServer applied more than once
incompatible_network_typeThe resources network type is not supported by Firewalls
firewall_resource_not_foundThe resource the Firewall should be attached to was not found

Servers

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 tcp and udp.

A port range can be specified by separating lower and upper bounds with a dash. 1024-5000 will include all ports starting from 1024 up to port 5000.

rules[].description String No

Description of the rule.

rules[].direction String Yes

Traffic direction in which the rule should be applied to.

Use source_ips for direction in and destination_ips for direction out to specify IPs.

Possible values:

  • "out"
  • "in"
rules[].destination_ips[] Array No

List of permitted IPv4/IPv6 addresses for outgoing traffic.

The direction must be set to out.

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 10.0.1.0/24 or 2001:db8:ff00:42::/64, and a single host with 10.0.1.1/32 or 2001:db8:ff00:42::8329/128.

Use 0.0.0.0/0 to allow any IPv4 addresses and ::/0 to allow any IPv6 addresses.

rules[].protocol String Yes

Network protocol to apply the rule for.

Possible values:

  • "gre"
  • "tcp"
  • "udp"
  • "icmp"
  • "esp"
rules[].source_ips[] Array No

List of permitted IPv4/IPv6 addresses for incoming traffic.

The direction must be set to in.

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 10.0.1.0/24 or 2001:db8:ff00:42::/64, and a single host with 10.0.1.1/32 or 2001:db8:ff00:42::8329/128.

Use 0.0.0.0/0 to allow any IPv4 addresses and ::/0 to allow any IPv6 addresses.

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 (key/value pairs) for the Resource. For more information, see "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 type label_selector, otherwise null.

apply_to[].label_selector.selector String Yes

The selector.

apply_to[].type String Yes

Type of the resource.

Possible values:

  • "server"
  • "label_selector"
apply_to[].server Object No

Server the Firewall is applied to.

Only set for type server, otherwise null.

apply_to[].server.id Integer Yes

ID of the Server.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. 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.
  3. Click Test request to test run your request to the API and see the API's response.