Interface route
The routes of an interface
Drop a route that osapi wrote
Drops the route from the interface's netplan file and applies what is left; the last route removes the file. A route osapi does not have does not change.
List the routes of an interface
Reads the routes of the main table that go out of the interface: ip route on Linux, netstat on macOS. proto says where a route came from, such as dhcp, kernel or static. An interface with no routes has none; one the host does not have is not found.
Add a static route to an interface
Adds the route to the interface's netplan file, such as /etc/netplan/osapi-osapi0-routes.yaml for osapi0, under a netplan definition that is the interface's own, and applies it. A route osapi already has, the same, does not change; one to the same destination by another gateway or metric is refused: update changes it. A default route is refused: the interface behavior sets the gateway. An interface the host does not have is not found. An interface that a match defines, such as cloud-init's all for en*, is refused, because the route would go on each interface the match takes. It runs on the Debian family, and elsewhere, and in a container, reports skipped.
Change the gateway or the metric of a route
Writes the route over the one osapi has to the same destination, and applies it. A destination osapi has no route to is not found: create adds it.