luqasz/librouteros

Arbitrary command implementation

Closed this issue · 1 comments

I'm working on ansible module for routeros api, so far everything work as expected however I have specific question about arbitrary command

If is used for path like /system script run number=0 is ok however I'm not sure how to implement it for situation like
/ip service disable telent which lead to

script = api.path('ip', 'service')
tuple(script('disable', **{'telent': ???????}))

let me know if I did not explain my question well

For this I found workaround ( /ip service disable numbers=telnet) but still as general ..

Probably something similar is needed but for simple list[] which will allow free cmd use .. no idea

 def compose_word(key: str, value: typing.Any) -> str:
    """
    Create a attribute word from key, value pair.
    Values are casted to api equivalents.
    """
    return '={}={}'.format(key, cast_to_api(value))