Skip to main content

Python API to interact with Ruckus Unleashed and ZoneDirector devices.

Project description

aioruckus

A Python API which interacts with Ruckus Unleashed and ZoneDirector devices via their AJAX Web Service interface.

Compatible with all Ruckus Unleashed versions, and Ruckus ZoneDirector versions 9.10 onwards.

How to install

pip install aioruckus

Usage

Functions are defined within an async context manager, so you will have to use asyncio rather than calling the functions directly in a shell.

from aioruckus import AjaxSession, SystemStat
import asyncio

async def test_aioruckus():
    
    async with AjaxSession.async_create("<ruckus ip>", "<ruckus user>", "<ruckus password>") as session:
        ruckus = session.api

        wlans = await ruckus.get_wlans()
        wlan_groups = await ruckus.get_wlan_groups() # WLAN Groups are CLI-only on Unleashed
        aps = await ruckus.get_aps()
        ap_groups = await ruckus.get_ap_groups()
        mesh = await ruckus.get_mesh_info()
        default_system_info = await ruckus.get_system_info()
        all_system_info = await ruckus.get_system_info(SystemStat.ALL)
        active_clients = await ruckus.get_active_clients()
        inactive_clients = await ruckus.get_inactive_clients() # always empty on Unleashed
        blocked = await ruckus.get_blocked_client_macs()
        syslog = await ruckus.get_syslog()

        await ruckus.do_block_client("60:ab:de:ad:be:ef")
        await ruckus.do_unblock_client("60:ab:de:ad:be:ef")

        await ruckus.do_disable_wlan("my ssid")
        await ruckus.do_enable_wlan("my ssid")

        await ruckus.do_set_wlan_password("my ssid", "blah>blah<")

        await ruckus.do_add_wlan_group("new empty wlangroup", "empty group added by aioruckus")
        await ruckus.do_add_wlan_group("new full wlangroup", "group added by aioruckus", wlans)

        wlan_group_template = next((wlang for wlang in wlan_groups if wlang["name"] == "Default"), None)
        await ruckus.do_clone_wlan_group(wlan_group_template, "Copy of Default")

        await ruckus.do_delete_wlan_group("Copy of Default")

        await ruckus.do_add_wlan("my new sid", passphrase="mypassphrase" )
        await ruckus.do_edit_wlan("my new sid", {"ofdm-rate-only": True})

        template_wlan = next((wlan for wlan in wlans if wlan["name"] == "my ssid"), None)
        await ruckus.do_clone_wlan(template_wlan, "my newer sid")
        await ruckus.do_delete_wlan("my newer sid")

        await ruckus.do_hide_ap_leds("24:79:de:ad:be:ef")
        await ruckus.do_show_ap_leds("24:79:de:ad:be:ef")
        
        await ruckus.do_restart_ap("24:79:de:ad:be:ef")

asyncio.run(test_aioruckus())

Other Python APIs for Ruckus Unleashed

This project was originally a fork of pyuckus, which provides similar query functionality by controlling an SSH CLI session.

There is also scrapli support for the Ruckus Unleashed SSH CLI via scrapli community.
Authentication and privilege levels are implemented, but no templates are implemented as of April 2023.

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

aioruckus-0.24.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

aioruckus-0.24-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file aioruckus-0.24.tar.gz.

File metadata

  • Download URL: aioruckus-0.24.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for aioruckus-0.24.tar.gz
Algorithm Hash digest
SHA256 b07208728a0fdc1e9b7346bec67b0943ca58be9761d597cb9154ee89d58700b3
MD5 1513f38a068882c1c6742b868cfb4b94
BLAKE2b-256 224bd5af1b817d73c3a7e3ffde9900a0a8e0b0cd422e1f57137c4513d8f1261e

See more details on using hashes here.

File details

Details for the file aioruckus-0.24-py3-none-any.whl.

File metadata

  • Download URL: aioruckus-0.24-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for aioruckus-0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 bd2ab9800b3a6b5b068f89a3c4324ce72c9feda6f9795c8aa6b4ef131f8d348d
MD5 817db9189b4ea7db25dd7b42bd4e9df8
BLAKE2b-256 74fb32536b0ab99b7cfcd9ea1dac1e5ac33d912aef8b1738d4c5ac9ea1bd7677

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