This flask app is a 'minified' Meraki Dashboard, providing select functionality for contractors and others who need to manipulate a Meraki environment without access to the entire dashboard. The following features/workflows are currently supported:
The app was originally designed with wireless contractors in mind, but it's easily extendable by copying the framework supporting the existing pages (see Expanding the App
).
In order to use the Meraki API, you need to enable the API for your organization first. After enabling API access, you can generate an API key. Follow these instructions to enable API access and generate an API key:
Organization > Settings > Dashboard API access
Enable access to the Cisco Meraki Dashboard API
My Profile > API access
Generate API key
For more information on how to generate an API key, please click here.
Note: You can add your account as Full Organization Admin to your organizations by following the instructions here.
This app provides a Docker
file for easy deployment. Docker
is the recommended deployment method. Install Docker
here.
git clone [repository name]
.env_sample
file to .env
..env
:# Meraki Section MERAKI_API_KEY=""
RADIUS_SERVERS
file contents (and value if using a different file name) and/or DEFAULT_VLAN
variable in config.py
.# Static JSON Files RADIUS_SERVERS = "radius_servers.json" # AP VLAN Tagging Config DEFAULT_VLAN = 0
[ { "area": 1, "primary_server": { "host": "10.X.X.3", "port": 3000, "secret": "some-secret", "radsecEnabled": false }, "secondary_server": { "host": "10.X.X.5", "port": 3000, "secret": "another-secret", "radsecEnabled": false } } ]
pip3 install -r requirements.txt
To run the program (from the top-level directory), use the following command to run with python directly:
$ python3 flask_app/app.py
or with the docker command:
$ docker-compose up -d --build
Note: App logs and output are written to Stdout console and log files in flask_app/logs
Once the app is running, navigate to http://127.0.0.1:5000 to be greeted with the main landing page (overview page):
Select an organization and network with the dropdown options on the left menu bar, and you will see all available workflows (using the org and network as their context):
In general, pages are divided into informational
workflows (display information), and configuration
workflows (modify state of object). For configuration workflows, select the object to modify with the checkbox (step 1), modify desired fields (step 2), and click submit.
Each workflow is shown below:
Network Devices List
(Informational)
SSID
(Configuration)
Access Point
(Configuration)
Claim Devices
(Configuration)
The app was purposely written to be modular and consistent in its design to encourage extensibility. The architecture of the app follows a simple Flask App:
app.py
templates/
static/
Before adding new functionality, it's recommended to study the existing pages. In general, the important components are:
*.html
): (extending the masterPage.html
's headers and footers plus the menu.html
's sidebar.)app.py
): each page has a route which reads in the various URL params and Form arguments (textbox input, dropdown selection, etc.), makes the appropriate Meraki API call with these values, and renders the HTML page for that workflow.menu.html
): this html page represents the menu bar on the left of the screen. Each workflow has an entry here with an href
that calls the respective routes in app.py
.Context
(the current org and network) is kept between flask calls with URL Params. This is critically important and leveraged in all routes and redirects.
When adding new functionality, it's recommended to copy an existing html page, route, and menu.html entry. Then from there, modify the html (tables, input fields), change the corresponding values read in the app.py route, add your underlying route logic, and finally, create an entry in menu.html.
Provided under Cisco Sample Code License, for details see LICENSE
Our code of conduct is available here
See our contributing guidelines here
Please note: This script is meant for demo purposes only. All tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use.
You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community