A simple interactive CLI for pulling common data out of Cisco Catalyst
Center (formerly DNA Center) over its REST API — no need to remember
endpoint paths or write one-off curl commands. 🚀
Run it, enter the appliance IP/hostname and your login, and pick from a menu of read-only API calls.
- 🔑 Prompts for Catalyst Center IP/hostname, username, and password
- 🔄 Authenticates via
/dna/system/api/v1/auth/tokenand auto re-authenticates if the token expires - 📋 Menu-driven access to:
- 💚 Overall network health
- 🖥️ Device inventory
- 🏢 Site health
- 📱 Client health
⚠️ Open issues- ✅ Compliance status
- 💿 Software images
- 🗺️ Physical topology summary
- 🔧 Custom raw GET call (any endpoint path, for anything not covered above)
- 🔍 Search the menu itself, or filter/search within any results table
- 📄 Auto-pagination for endpoints with 500+ records — nothing gets silently cut off
- 🎨 Pretty table output via
tabulate, colored terminal output viacolorama
- Python 3.8+
- Network reachability to your Catalyst Center appliance (HTTPS, port 443)
- An account with API access on Catalyst Center
git clone https://github.com/mizitheji/catalyst-center-API.git
cd catalyst-center-API
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtpython3 dnac_menu.pyYou'll be prompted for:
Catalyst Center IP/hostname: 10.10.10.1
Username: admin
Password:
Then pick a number from the menu to run that API call.
- Search the menu itself — type
/keywordat theChoice:prompt (e.g./health,/issue) instead of a number. Handy once you've added a lot of menu items. - Search within results — any menu item that returns a table (inventory, health, issues, compliance, etc.) drops you into a search box after printing the table. Type any term to filter rows where any column contains it (case-insensitive),
cto clear the filter, or hit Enter to go back to the main menu.
- 🔓 TLS certificate verification is disabled by default (
verify=False) since most Catalyst Center deployments use self-signed certs. If your appliance has a trusted cert, you can setverify_ssl=Truewhen constructingCatalystCenterindnac_menu.py. - ✅ This tool only issues GET requests — it does not push config or make changes to your environment.
- 📄 Catalyst Center caps most list endpoints at 500 records per call
(
offset/limitquery params). Device Inventory, Site Health, Open Issues, Compliance Status, and Software Images all useCatalystCenter.get_all_pages(), which pages through automatically until every record is fetched. If you add a new menu item for another list endpoint that could exceed 500 results, calldnac.get_all_pages(path, params=...)instead ofdnac.get(...)to get the same behavior. - 🗂️ The "Custom raw GET call" menu option prints only the first 4000
characters to the terminal (so a huge JSON blob doesn't flood your
screen) but always saves the full, untruncated response into a
raw_output/folder (created automatically) asraw_output_<timestamp>.json. It also asks whether to auto-paginate — say yes for list endpoints, no for single-object endpoints like/count. This folder is git-ignored since it may contain your real device/site data. - 🛠️ The "Custom raw GET call" menu option lets you hit any other read-only endpoint from the Catalyst Center API docs without needing to add a dedicated menu function first.
Adding a new menu item is a copy-paste job:
- Write a function that takes
dnac, callsdnac.get(path)ordnac.get_all_pages(path)for list endpoints, and prints the result withdisplay_table(rows, headers) - Add one line to the
MENU_ITEMSlist at the bottom ofdnac_menu.py
That's it — token refresh, error handling, pagination, and search all come for free.
MIT — see LICENSE.