Skip to main content

No project description provided

Project description

aiorosapi

Simple asyncio-based library to perform API queries on Mikrotik RouterOS-based devices.

Installation

Install from PyPi:

pip install aiorosapi

Install from sources:

git clone https://github.com/gaussgss/aiorosapi.git
cd aiorosapi
python setup.py install

Usage

import asyncio
from aiorosapi.protocol import create_ros_connection


async def main():
    conn = await create_ros_connection(
        host='192.168.90.1',
        port=8728,
        username='admin',
        password=''
    )

    data = await conn.talk_one('/system/routerboard/print')
    print("Routerboard info:")
    for k, v in data.items():
        print('{:>20s}: {}'.format(k, v))

    data = await conn.talk_all('/interface/ethernet/print')
    print("Ethernet interfaces:")
    for item in data:
        print("{:>20s}: {}".format(item['.id'], item['name']))

    await conn.disconnect()
    await conn.wait_disconnect()



if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.close()

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

aiorosapi-0.2.4.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file aiorosapi-0.2.4.tar.gz.

File metadata

  • Download URL: aiorosapi-0.2.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for aiorosapi-0.2.4.tar.gz
Algorithm Hash digest
SHA256 1bca72280a6e247556daaf552027af15f6e4881aad97c16746ad6ac80326d428
MD5 fbde75a9f9f0d2f229e874b3214c1c43
BLAKE2b-256 281ec2ae2c07401e43a4f32c5f8c33beb41ef4975f2de57fcd98acd5159a5d8e

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