C9800 can be accessed from RESTCONF using YANG model. But YANG model is very difficult to find the correct url and parameters. So I created the C9800 API wrapper. This is useful for the c9800 API beginner because you don't have to care about IOS-XE YANG model.
git clone https://github.com/dmatsumu/c9800-RESTCONF
cd c9800-RESTCONF
pip install virtualenv
python3 -m venv .
source ./bin/activate
pip3 install -r requirements.txt
You need to input the below parameter into "config.json" file according to your environment.
- username
- password
- <WLC_ip_address> in base_url
You need to import "getApInfo.py" and "getClientInfo.py" into your python code. Please refer to the sample_code.py, if you need a sample.
display APs under the WLC
display WLANs under the WLC
display AP radio operation info from "Cisco-IOS-XE-wireless-access-point-oper:radio-oper-data"
display AP operation info from "Cisco-IOS-XE-wireless-access-point-oper:oper-data"
display AP MAC address from "Cisco-IOS-XE-wireless-access-point-oper:ap-name-mac-map"
display WLAN ID from "Cisco-IOS-XE-wireless-wlan-cfg:wlan-cfg-entry"
display ssid counters info from "Cisco-IOS-XE-wireless-access-point-oper:ssid-counters"
display CAPWAP info from "Cisco-IOS-XE-wireless-access-point-oper:capwap-data"
display RRM operation info from "Cisco-IOS-XE-wireless-rrm-oper:rrm-oper-data"
dispaly AP summary info from many sources with AP name and radio slot number
dispaly AP summary info from many sources with AP name ONLY
display Client common operation data under the WLC
display Client dot11 operation data under the WLC
display Client traffic stastics under the WLC
display Client ip mac binding table under the WLC
display Client device info under the WLC
display Client common operation data by mac under the WLC
display Client dot11 operation data by mac under the WLC
display Client traffic stastics by mac under the WLC
display Client ip mac binding table by mac under the WLC
display Client device info by mac under the WLC
display Client IP address by mac
display Client MAC address by Client IP
display Client MAC address by username
dispaly Client info summary by Client IP
dispaly Client info summary by Client username
- This python code is build in my lab environment. Please note that errors may occur depending on the environment.
- If you want to use "ssid-counters", you need to edit your c9800's AP join profile configuration according to the following.
no statistics traffic-distribution
bssid-stats
bssid-stats bssid-stats-frequency 30
- release (2024/1/5)
- AP information is updated. (2024/1/10)
- Client information is up. (2024/1/10)
- Client information is updated. (2024/1/11)
- Client information is updated. (2024/1/17)
- Client information is updated. (2024/1/19)
- Change error handling on AP and Client python (2024/2/7)