update_firewall_rule
update_firewall_rule
Section titled “update_firewall_rule”Patch fields on an existing firewall rule.
Side effects:
- Modifies the named rule in place. Only fields supplied in
updateschange; everything else is preserved. - Takes effect immediately on the next packet hitting the affected datapath.
- Mutates controller state. Use dry_run=True to preview the change without applying.
Example
Section titled “Example”update_firewall_rule(rule_id="65f...", updates={"enabled": False})Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
rule_id | string | yes | — | The _id from list_firewall_rules. |
updates | object | yes | — | Partial firewall-rule record. Common keys: enabled, action, protocol, rule_index, src_address, dst_address, src_networkconf_id, dst_networkconf_id, src_port, dst_port, name. |
controller | string | no | ”default” | Name of the UniFi controller to target. Defaults to "default". |
dry_run | boolean | no | false | Preview the change without applying it. Returns the predicted change set. |