Skip to content

How can you search for an unset value? #72

@tal-zvon

Description

@tal-zvon

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions