Event Driven QoS is a simple demo application illustrating programmatic control of APIC-EM to change QoS parameters in an attached network. This is driven by an external event.
There are three containers involved in the delivery of the application:
- edqos_app (this container) - responsible for presenting API calls for external events to toggle the status of configured applications.
- edqos_data - implements an abstraction layer over the configuration database. Currently implemented as SQLite and lacking in persistence between launches of the container.
- edqos_web - front end application for configuration and status reporting. Includes manual event triggers to confirm proper functioning of the application.
Additionally, an optional installation repository is available as edqos_installer. This repository includes scripts for installation into an instance of mantl as well as a docker-compose script.
Prerequisites
- Python 3
pip install -r requirements.txt
Option A:
If you have git installed, clone the repositories into the same directory.
git clone https://github.com/imapex/edqos_app
Option B:
If you don't have git, download a zip copy of the repository and extract.
To install the application to the DevNet Mantl Sandbox using the DevNet APIC EM Sandbox:
- Set your docker username
export $DOCKERUSER=<your_username>
- Execute the following commands
cp edqos_sample.json edqos_$DOCKERUSER.json sed -i "" -e "s/DOCKERUSER/$DOCKERUSER/g" edqos_$DOCKERUSER.json curl -k -X POST -u admin:1vtG@lw@y https://mantlsandbox.cisco.com:8080/v2/apps \ -H "Content-type: application/json" \ -d @edqos_$DOCKERUSER.json \ | python -m json.tool
You can modify the sample app definition and commands above to deploy to your own Mantl instance.
You can also run the application locally rather than in a container environment by the following:
python app.py
The application provides an API interface for getting QOS information out of APIC EM.
The supported APIs are:
- /api/policy_tags/ - (GET) Responds with list of policy tags available in APIC EM
- /api/applications/ - (GET) Responds with list of applications known to APIC EM
- Optional argument:
search=<string>
Responds with list of applications matching search string
- Optional argument:
- /api/relevance/ - (GET) Responds with current relevance level for an application within a given scope
- Required argument:
app=<string>
needs exact application name as known by APIC EM - Required argument:
policy=<string>
needs exact policy tag as known by APIC EM
- Required argument:
- /api/relevance/ - (POST) Sets the given application to the given relevance level; takes application/x-www-form-urlencoded data
- Required data:
app=<string>
needs exact application name as known by APIC EM - Required data:
policy=<string>
needs exact policy tag as known by APIC EM - Required data:
relevance=<string>
needs exact relevance level as known by APIC EM ("Business-Relevant", "Default", "Business-Irrelevant")
- Required data:
Development requires access to Cisco's DevNet sandbox APIC-EM server, or a suitable on-site installation. Send us a Pull Request with suggested changes.