Community discussions

MikroTik App
 
cmassey
just joined
Topic Author
Posts: 20
Joined: Fri Nov 08, 2019 8:06 am

Python RouterOS-api vs laiarturs-ros-api

Tue Aug 08, 2023 10:51 pm

I've been using RouterOS-api for a while now but I see there is also laiarturs-ros-api. It appears to be less used but newer. It also seems simpler. Here are a couple examples:
import routeros_api
connection = routeros_api.RouterOsApiPool('192.168.28.1', 'admin', 'goodpassword', plaintext_login=True)
api = connection.get_api()
nat_rules_api = api.get_resource('/ip/firewall/nat')
nat_rules = nat_rules_api.get()
print(nat_rules)
import ros_api
connection = ros_api.Api('192.168.28.1', 'admin', 'goodpassword')
nat_rules = connection.talk('/ip/firewall/nat/print')
print(nat_rules)
I have a feeling that it's probably just going to end up being preference but does anyone have experience with both or insight about problems with either?
 
aris22
just joined
Posts: 5
Joined: Sat Jan 06, 2024 8:49 pm

Re: Python RouterOS-api vs laiarturs-ros-api

Sun Jan 07, 2024 11:01 pm

I am using laiarturs-ros-api for a project that I have just started, although the way of sending commands with a space is still a bit inconvenient for me, but leaving this aside for now seems to be a good option given its simplicity.

EDIT:
Apparently it is a project that has been in development for quite some time.
https://github.com/LaiArturs/RouterOS_API

Who is online

Users browsing this forum: rextended and 10 guests