Skip to content

update_vlan

Patch fields on an existing VLAN/network record.

Side effects:

  • Modifies the named network in place. Only fields supplied in updates change; everything else is preserved.
  • Changes to vlan or ip_subnet may disconnect clients on the affected network. A change to ip_subnet that would leave the existing dhcpd_start / dhcpd_stop outside the new subnet is refused unless both are passed in the same update, because the controller keeps the old pool and the network then hands out no addresses.
  • Mutates controller state. Use dry_run=True to preview the change without applying.

Verified write: after applying, the network is re-read from the controller and the response carries a verification block listing persisted_fields, unchanged_fields (already correct before the write), dropped_fields (silently discarded by the controller), coerced_fields (stored with a different value or type), and unverifiable_fields. purpose is a known coercion site: controllers running the zone-based firewall model may accept purpose="guest" and store "corporate". A response with verified: false and mutation_applied: true means the controller accepted the write but did not store it exactly — that is not a rollback, and the record may be in a mixed state.

update_vlan(network_id="65f...", updates={"enabled": False})
Parameter Type Required Default Description
network_id string yes The _id from list_networks.
updates object yes Partial network record. Common keys: name, vlan, ip_subnet, dhcpd_start, dhcpd_stop, enabled, mdns_enabled (toggle the per-VLAN mDNS reflector independently of network creation), purpose.
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.