Trying to get the default route on the router in the main routing table.
Can't figure out how to tell .get() that I'm looking for an item where the routing_mark field is unset.
#!/usr/bin/env python3
import routeros_api
args = {
"host": "1.2.3.4",
"username": "admin",
"password": "PASSWORD",
...
}
api_connection = routeros_api.RouterOsApiPool(**args)
api = api_connection.get_api()
routes = api.get_resource("/ip/route")
default_route = routes.get(dst_address="0.0.0.0/0", disabled="no", routing_mark=None)
None doesn't work. "none" doesn't seem to work either. Is there a way to do this?
Trying to get the default route on the router in the main routing table.
Can't figure out how to tell
.get()that I'm looking for an item where therouting_markfield is unset.None doesn't work. "none" doesn't seem to work either. Is there a way to do this?