Skip to content
  • Auto
  • Light
  • Dark

Firewalls

Firewalls

Firewalls

Create a New Firewall
gpu_droplets.firewalls.create(FirewallCreateParams**kwargs) -> firewallFirewallFirewallCreateResponse
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) -> metaMetaPropertiesfirewallslistlinksPageLinksFirewallListResponse
get/v2/firewalls
Retrieve an Existing Firewall
gpu_droplets.firewalls.retrieve(strfirewall_id) -> firewallFirewallFirewallRetrieveResponse
get/v2/firewalls/{firewall_id}
Update a Firewall
gpu_droplets.firewalls.update(strfirewall_id, FirewallUpdateParams**kwargs) -> firewallFirewallFirewallUpdateResponse
put/v2/firewalls/{firewall_id}
Firewall
Firewallclass
ShowShow
idstr
optional

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

created_atdatetime
optional

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

formatdate-time
droplet_idslist
optional
Optional[List[int]]

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

Requires droplet:read scope.

inbound_ruleslist
optional
Optional[List[InboundRule]]
Hide ParametersShow Parameters
portsstr

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

protocolliteral
Literal["tcp", "udp", "icmp"]

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

Hide ParametersShow Parameters
"tcp"
"udp"
"icmp"
sourcesaddresseslistdroplet_idslistkubernetes_idslistload_balancer_uidslisttagslistFirewallRuleTarget

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

namestr
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_ruleslist
optional
Optional[List[OutboundRule]]
Hide ParametersShow Parameters
destinationsaddresseslistdroplet_idslistkubernetes_idslistload_balancer_uidslisttagslistFirewallRuleTarget

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

portsstr

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

protocolliteral
Literal["tcp", "udp", "icmp"]

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

Hide ParametersShow Parameters
"tcp"
"udp"
"icmp"
pending_changeslist
optional
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.

Hide ParametersShow Parameters
droplet_idint
optional
removingbool
optional
statusstr
optional
statusliteral
optional
Optional[Literal["waiting", "succeeded", "failed"]]

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

Hide ParametersShow Parameters
"waiting"
"succeeded"
"failed"
tagslist
optional
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