Skip to content
  • Auto
  • Light
  • Dark

Firewalls

Firewalls

Firewalls

Create a New Firewall
post/v2/firewalls
Delete a Firewall
delete/v2/firewalls/{firewall_id}
List All Firewalls
get/v2/firewalls
Retrieve an Existing Firewall
get/v2/firewalls/{firewall_id}
Update a Firewall
put/v2/firewalls/{firewall_id}
Firewall
Firewallobject
ShowShow
idstring
optional

A unique ID that can be used to identify and reference a firewall.

created_atstring
optional

A time value given in ISO8601 combined date and time format that represents when the firewall was created.

formatdate-time
droplet_idsarray of number
optional

An array containing the IDs of the Droplets assigned to the firewall.

Requires droplet:read scope.

inbound_rulesarray of object
optional
Hide ParametersShow Parameters
portsstring

The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".

protocolenum
"tcp" OR "udp" OR "icmp"

The type of traffic to be allowed. This may be one of tcp, udp, or icmp.

Hide ParametersShow Parameters
"tcp"
"udp"
"icmp"
sourcesaddressesarray of stringdroplet_idsarray of numberkubernetes_idsarray of stringload_balancer_uidsarray of stringtagsarray of stringFirewallRuleTarget

An object specifying locations from which inbound traffic will be accepted.

namestring
optional

A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).

outbound_rulesarray of object
optional
Hide ParametersShow Parameters
destinationsaddressesarray of stringdroplet_idsarray of numberkubernetes_idsarray of stringload_balancer_uidsarray of stringtagsarray of stringFirewallRuleTarget

An object specifying locations to which outbound traffic that will be allowed.

portsstring

The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".

protocolenum
"tcp" OR "udp" OR "icmp"

The type of traffic to be allowed. This may be one of tcp, udp, or icmp.

Hide ParametersShow Parameters
"tcp"
"udp"
"icmp"
pending_changesarray of object
optional

An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.

Hide ParametersShow Parameters
droplet_idnumber
optional
removingboolean
optional
statusstring
optional
statusenum
optional
"waiting" OR "succeeded" OR "failed"

A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".

Hide ParametersShow Parameters
"waiting"
"succeeded"
"failed"
tagsarray of string
optional

A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.

Requires tag:create and tag:read scopes.

FirewallsDroplets

Add Droplets to a Firewall
post/v2/firewalls/{firewall_id}/droplets
Remove Droplets from a Firewall
delete/v2/firewalls/{firewall_id}/droplets

FirewallsRules

Add Rules to a Firewall
post/v2/firewalls/{firewall_id}/rules
Remove Rules from a Firewall
delete/v2/firewalls/{firewall_id}/rules

FirewallsTags

Add Tags to a Firewall
post/v2/firewalls/{firewall_id}/tags
Remove Tags from a Firewall
delete/v2/firewalls/{firewall_id}/tags