Skip to content

update_traffic_route

Patch fields on an existing traffic route (read-modify-write).

Side effects:

  • Modifies the named policy route in place. The v2 PUT replaces the whole object, so this reads the current route first and merges your changes onto it before writing — only the keys you supply change.
  • Changes where matched traffic is routed (and, via kill_switch_enabled, whether it is dropped when the route’s interface is down). Takes effect immediately.
  • Mutates controller state. Use dry_run=True to preview the change without applying.
update_traffic_route(route_id="65f...", kill_switch_enabled=True)
ParameterTypeRequiredDefaultDescription
route_idstringyesThe _id from list_traffic_routes.
updates`objectnull`nonull
kill_switch_enabled`booleannull`nonull
controllerstringno”default”Name of the UniFi controller to target. Defaults to "default".
dry_runbooleannofalsePreview the change without applying it. Returns the predicted change set.