RouterOS v7 REST API python module
Project description
RosRestPy
RouterOS v7 REST API python module
RouterOS v7 REST API Support
Not all types and methods of the RouterOS v7 REST API are supported, yet. Finding any bugs? Please Create Issue
Installing
You can install or upgrade rosrestpy with:
pip install rosrestpy --upgrade
Example
from ros import Ros
# Initiate Ros object
ros = Ros("https://192.168.88.1/", "admin", "")
# Check cpu load
if ros.system.resource.cpu_load > 90:
print(f"{ros.system.identity}'s CPU > 90%")
# Print all interface name
for interface in ros.interface():
print(interface.name)
# Finding specific queue
queues = ros.queue.simple(name="Hotspot")
if len(queues) == 1:
queue = queues[0]
print(f"Usage {queue.bytes}")
# Adding new /simple/queue
from ros.queue import SimpleQueue
new_queue = SimpleQueue(name="Test", target="192.168.88.0/24", max_limit="10M/10M", disabled=True)
new_queue = ros.queue.simple.add(new_queue)
print(new_queue)
# Using /tool/bandwith-test
bw_tests = ros.tool.bandwith_test("172.16.0.1", "3s", "admin", direction="both")
result_bw_test = bw_tests[-1]
print(f"Download {result_bw_test.rx_total_average}")
print(f"Upload {result_bw_test.tx_total_average}")
Resources
The RouterOS REST API is the technical reference for rosrestpy
.
Contributing
Contributions of all sizes are welcome. Please review our contribution guidelines to get started. You can also help by reporting bugs or feature requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rosrestpy-0.5.1.tar.gz
(32.5 kB
view hashes)
Built Distribution
rosrestpy-0.5.1-py3-none-any.whl
(49.0 kB
view hashes)
Close
Hashes for rosrestpy-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | daaae762cfb52ea8725dddfc5574a96d57c894ef5e371da55760d80bf6120d4d |
|
MD5 | e86aa037dc7ab934df2aa400e4474d72 |
|
BLAKE2b-256 | 307a69eb49639cd7a5947bee47245cb9610a7fbc13f13a7df8c785855c8d73ea |