Skip to content
  • Auto
  • Light
  • Dark

Firewalls

Firewalls

Create a New Firewall
gpu_droplets.firewalls.create(FirewallCreateParams**kwargs) -> FirewallCreateResponse
post/v2/firewalls
Delete a Firewall
gpu_droplets.firewalls.delete(strfirewall_id)
delete/v2/firewalls/{firewall_id}
List All Firewalls
gpu_droplets.firewalls.list(FirewallListParams**kwargs) -> FirewallListResponse
get/v2/firewalls
Retrieve an Existing Firewall
gpu_droplets.firewalls.retrieve(strfirewall_id) -> FirewallRetrieveResponse
get/v2/firewalls/{firewall_id}
Update a Firewall
gpu_droplets.firewalls.update(strfirewall_id, FirewallUpdateParams**kwargs) -> FirewallUpdateResponse
put/v2/firewalls/{firewall_id}
ModelsExpand Collapse
class Firewall:
id: Optional[str]

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

created_at: Optional[datetime]

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

formatdate-time
droplet_ids: Optional[List[int]]

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

Requires droplet:read scope.

inbound_rules: Optional[List[InboundRule]]
ports: str

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".

protocol: Literal["tcp", "udp", "icmp"]

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

Accepts one of the following:
"tcp"
"udp"
"icmp"

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

name: Optional[str]

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_rules: Optional[List[OutboundRule]]
destinations: FirewallRuleTarget

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

ports: str

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".

protocol: Literal["tcp", "udp", "icmp"]

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

Accepts one of the following:
"tcp"
"udp"
"icmp"
pending_changes: Optional[List[PendingChange]]

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.

droplet_id: Optional[int]
removing: Optional[bool]
status: Optional[str]
status: Optional[Literal["waiting", "succeeded", "failed"]]

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

Accepts one of the following:
"waiting"
"succeeded"
"failed"
tags: Optional[List[str]]

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
gpu_droplets.firewalls.droplets.add(strfirewall_id, DropletAddParams**kwargs)
post/v2/firewalls/{firewall_id}/droplets
Remove Droplets from a Firewall
gpu_droplets.firewalls.droplets.remove(strfirewall_id, DropletRemoveParams**kwargs)
delete/v2/firewalls/{firewall_id}/droplets

FirewallsRules

Add Rules to a Firewall
gpu_droplets.firewalls.rules.add(strfirewall_id, RuleAddParams**kwargs)
post/v2/firewalls/{firewall_id}/rules
Remove Rules from a Firewall
gpu_droplets.firewalls.rules.remove(strfirewall_id, RuleRemoveParams**kwargs)
delete/v2/firewalls/{firewall_id}/rules

FirewallsTags

Add Tags to a Firewall
gpu_droplets.firewalls.tags.add(strfirewall_id, TagAddParams**kwargs)
post/v2/firewalls/{firewall_id}/tags
Remove Tags from a Firewall
gpu_droplets.firewalls.tags.remove(strfirewall_id, TagRemoveParams**kwargs)
delete/v2/firewalls/{firewall_id}/tags