Skip to content

Firewalls

List All Firewalls
client.GPUDroplets.Firewalls.List(ctx, query) (*GPUDropletFirewallListResponse, error)
get/v2/firewalls
Create a New Firewall
client.GPUDroplets.Firewalls.New(ctx, body) (*GPUDropletFirewallNewResponse, error)
post/v2/firewalls
Retrieve an Existing Firewall
client.GPUDroplets.Firewalls.Get(ctx, firewallID) (*GPUDropletFirewallGetResponse, error)
get/v2/firewalls/{firewall_id}
Update a Firewall
client.GPUDroplets.Firewalls.Update(ctx, firewallID, body) (*GPUDropletFirewallUpdateResponse, error)
put/v2/firewalls/{firewall_id}
Delete a Firewall
client.GPUDroplets.Firewalls.Delete(ctx, firewallID) error
delete/v2/firewalls/{firewall_id}
ModelsExpand Collapse
type Firewall struct{…}
ID stringoptional

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

CreatedAt Timeoptional

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

formatdate-time
DropletIDs []int64optional

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

Requires droplet:read scope.

InboundRules []FirewallInboundRuleoptional
Ports string

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 FirewallInboundRulesProtocol

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

Accepts one of the following:
const FirewallInboundRulesProtocolTcp FirewallInboundRulesProtocol = "tcp"
const FirewallInboundRulesProtocolUdp FirewallInboundRulesProtocol = "udp"
const FirewallInboundRulesProtocolIcmp FirewallInboundRulesProtocol = "icmp"

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

Addresses []stringoptional

An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.

DropletIDs []int64optional

An array containing the IDs of the Droplets to which the firewall will allow traffic.

KubernetesIDs []stringoptional

An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.

LoadBalancerUids []stringoptional

An array containing the IDs of the load balancers to which the firewall will allow traffic.

Tags []stringoptional

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.

Name stringoptional

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 (-).

OutboundRules []FirewallOutboundRuleoptional
Destinations FirewallRuleTarget

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

Addresses []stringoptional

An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.

DropletIDs []int64optional

An array containing the IDs of the Droplets to which the firewall will allow traffic.

KubernetesIDs []stringoptional

An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.

LoadBalancerUids []stringoptional

An array containing the IDs of the load balancers to which the firewall will allow traffic.

Tags []stringoptional

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.

Ports string

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 FirewallOutboundRulesProtocol

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

Accepts one of the following:
const FirewallOutboundRulesProtocolTcp FirewallOutboundRulesProtocol = "tcp"
const FirewallOutboundRulesProtocolUdp FirewallOutboundRulesProtocol = "udp"
const FirewallOutboundRulesProtocolIcmp FirewallOutboundRulesProtocol = "icmp"
PendingChanges []FirewallPendingChangeoptional

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.

DropletID int64optional
Removing booloptional
Status stringoptional
Status FirewallStatusoptional

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

Accepts one of the following:
const FirewallStatusWaiting FirewallStatus = "waiting"
const FirewallStatusSucceeded FirewallStatus = "succeeded"
const FirewallStatusFailed FirewallStatus = "failed"
Tags []stringoptional

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
client.GPUDroplets.Firewalls.Droplets.Add(ctx, firewallID, body) error
post/v2/firewalls/{firewall_id}/droplets
Remove Droplets from a Firewall
client.GPUDroplets.Firewalls.Droplets.Remove(ctx, firewallID, body) error
delete/v2/firewalls/{firewall_id}/droplets

FirewallsTags

Add Tags to a Firewall
client.GPUDroplets.Firewalls.Tags.Add(ctx, firewallID, body) error
post/v2/firewalls/{firewall_id}/tags
Remove Tags from a Firewall
client.GPUDroplets.Firewalls.Tags.Remove(ctx, firewallID, body) error
delete/v2/firewalls/{firewall_id}/tags

FirewallsRules

Add Rules to a Firewall
client.GPUDroplets.Firewalls.Rules.Add(ctx, firewallID, body) error
post/v2/firewalls/{firewall_id}/rules
Remove Rules from a Firewall
client.GPUDroplets.Firewalls.Rules.Remove(ctx, firewallID, body) error
delete/v2/firewalls/{firewall_id}/rules