Execute API calls to Omada Controller from python code
Project description
omada_client
Python client for Tp-Link Omada Controller (Omada Software Controller). Execute API calls to Omada Controller from python code.
Installation
pip install omada_client
Examples
Create class
from omada_client import OmadaClient
omada = OmadaClient( 'OMADA_DOMAIN', 'OMADA_USER', 'OMADA_PASSWORD' )
where:
- OMADA_DOMAIN: URL of Omada WebUi page
- OMADA_USER: Username of Omada WebUi
- OMADA_PASSWORD: Password of Omada WebUi
or using environment variables "OMADA_DOMAIN" and "OMADA_USER" and "OMADA_PASSWORD":
import os
from dotenv import load_dotenv
from omada_client import OmadaClient
load_dotenv()
omada = OmadaClient( os.getenv('OMADA_DOMAIN'), os.getenv('OMADA_USER'), os.getenv('OMADA_PASSWORD') )
Methods
# Get a list of WAN ports
omada.get_all_wan_ports()
# Get WAN port by its name
omada.get_wan_ports_by_name("WAN/LAN1")
# Create a static route
omada.create_static_route(...)
# Create a static route from a large amount of data
omada.create_static_route_to_inteface_with_big_data(...)
# Create a group profile
omada.create_profile_group('gpoupName', ['8.8.8.8', '1.1.1.1'])
# Get list of devices
omada.get_devices()
# Get a client by their MAC address
omada.get_client_by_mac('ff:ff:ff:ff:ff:ff')
# Get all clients
omada.get_clients()
# Get a client by its IP address
omada.get_client_by_ip('10.0.0.100')
# Assign a fixed IP address to the client based on its MAC address
omada.set_client_fixed_address_by_mac('ff:ff:ff:ff:ff:ff', '10.0.0.100')
# Assign a fixed IP address to the client based on its IP address
omada.set_client_fixed_address_by_ip('10.0.0.100')
# Assign a dynamic IP address to the client
omada.set_client_dymanic_address_by_mac('ff:ff:ff:ff:ff:ff')
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
omada_client-1.1.3.tar.gz
(5.8 kB
view details)
File details
Details for the file omada_client-1.1.3.tar.gz
.
File metadata
- Download URL: omada_client-1.1.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e80f874cdab818a7f912c51dbe95f24f6b907d4738f9c9d55678297458d2f46 |
|
MD5 | f8070ce0333b8761dc8a0f82a5e1d8ac |
|
BLAKE2b-256 | 34ff7a5c0e793f64716d93df35172e576ceb627da8abb24dbc452c53fc4e4278 |