pydo.firewalls.update()
Generated on 1 Oct 2026
from pydo version
v0.43.0
Usage
client.firewalls.update(
firewall_id="bb4b2611-3d72-467b-8602-280330ecd65c",
body={
"name": "firewall",
"droplet_ids": [...],
"tags": {...},
...,
},
)Description
To update the configuration of an existing firewall, send a PUT request to
/v2/firewalls/{firewall_id}. The request should contain a full representation
of the firewall including existing attributes. Note that any attributes that
are not provided will be reset to their default values.
You must have read access (e.g. droplet:read) to all resources attached
to the firewall to successfully update the firewall.
Parameters
firewall_idstring requiredA unique ID that can be used to identify and reference a firewall.
idstring optional read-onlyExample:
bb4b2611-3d72-467b-8602-280330ecd65cA unique ID that can be used to identify and reference a firewall.
statusstring optional read-onlyA status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
created_atstring optional read-onlyExample:
2020-05-23T21:24:00ZA time value given in ISO8601 combined date and time format that represents when the firewall was created.
pending_changesarray of objects optional read-onlyExample:
[{'droplet_id': 8043964, 'removing': False, 'status': 'waiting'}]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.
Show child properties
droplet_idinteger optionalExample:
8043964removingboolean optionalExample:
Falsestatusstring optionalExample:
waiting
namestring requiredExample:
firewallA 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 (-).
droplet_idsarray of integers or null optionalExample:
[8043964]An array containing the IDs of the Droplets assigned to the firewall.
Requiresdroplet:readscope.tagsobject optionalinbound_rulesarray of objects or null optionalShow child properties
protocolstring requiredThe type of traffic to be allowed. This may be one of
tcp,udp, oricmp.portsstring requiredExample:
8000The 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".
actionstring optionalThe action to be taken when traffic matches the rule. This may be one of
allowordeny. For backward compatibility, this field is optional. When not set, it defaults toallow.sourcesobject requiredShow child properties
addressesarray of strings optionalExample:
['1.2.3.4', '18.0.0.0/8']An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
droplet_idsarray of integers optionalExample:
[8043964]An array containing the IDs of the Droplets to which the firewall will allow traffic.
load_balancer_uidsarray of strings optionalExample:
['4de7ac8b-495b-4884-9a69-1050c6793cd6']An array containing the IDs of the load balancers to which the firewall will allow traffic.
kubernetes_idsarray of strings optionalExample:
['41b74c5d-9bd0-5555-5555-a57c495b81a3']An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
tagsobject optional
outbound_rulesarray of objects or null optionalShow child properties
protocolstring requiredThe type of traffic to be allowed. This may be one of
tcp,udp, oricmp.portsstring requiredExample:
8000The 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".
actionstring optionalThe action to be taken when traffic matches the rule. This may be one of
allowordeny. For backward compatibility, this field is optional. When not set, it defaults toallow.destinationsobject requiredShow child properties
addressesarray of strings optionalExample:
['1.2.3.4', '18.0.0.0/8']An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
droplet_idsarray of integers optionalExample:
[8043964]An array containing the IDs of the Droplets to which the firewall will allow traffic.
load_balancer_uidsarray of strings optionalExample:
['4de7ac8b-495b-4884-9a69-1050c6793cd6']An array containing the IDs of the load balancers to which the firewall will allow traffic.
kubernetes_idsarray of strings optionalExample:
['41b74c5d-9bd0-5555-5555-a57c495b81a3']An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
tagsobject optional
Request Sample
Response Example
More Information
See /v2/firewalls/{firewall_id} in the API reference for additional detail on responses, headers, parameters, and more.