Skip to main content

RouterOS v7 REST API python module

Project description

RosRestPy

PyPi Package Version Supported Python versions LICENSE

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.

Open Source Notice

Big thanks to attrs and cattrs as the bases of rosrestpy, without them this module creation would be very tedious!

Project details


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.2.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rosrestpy-0.5.2-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file rosrestpy-0.5.2.tar.gz.

File metadata

  • Download URL: rosrestpy-0.5.2.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.8.16 Linux/5.15.0-1034-azure

File hashes

Hashes for rosrestpy-0.5.2.tar.gz
Algorithm Hash digest
SHA256 39f7e00bc645c3ab3f5d01a6d8ef1d0fa8dce52ae931b5b84285d29ba6c0b968
MD5 af06d600ba6bb3caf64080f3e94d8679
BLAKE2b-256 1d07ffff6e680915827c3638c4d2bcbd5c621cacde3c5d0013c6e4408f8cf86a

See more details on using hashes here.

File details

Details for the file rosrestpy-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: rosrestpy-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.8.16 Linux/5.15.0-1034-azure

File hashes

Hashes for rosrestpy-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d8ddb9c2e31ab5bd9ec16efa53bc692e7d7cc49ae3c3a94d8804080d1b936d4
MD5 75b8d40d33745860dad6912a0bde969e
BLAKE2b-256 8eb4ad61880123a7b68f38d814c42313b4ea6d5fbb8d9936219437dea12de6f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page