update_route
update_route
Section titled “update_route”Patch fields on an existing static route.
Side effects:
- Modifies the named route in place. Only fields supplied in
updateschange; everything else is preserved. - Takes effect immediately on the gateway’s routing table.
- Mutates controller state. Use dry_run=True to preview the change without applying.
Example
Section titled “Example”update_route(route_id="65f...", updates={"enabled": False})Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
route_id | string | yes | — | The _id from list_routes. |
updates | object | yes | — | Partial route record. Common keys: name, enabled, static-route_network (destination CIDR), static-route_nexthop (next-hop IP), static-route_distance. |
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. |