An intermediate web server or application which acts as an forwarder for processing REST event notifications received from Cisco DNA center, by converting the recieved message into Message format of Feishu/Lark Application.
- Raveesh Malyavantham V
- Python
- Flask
- Feishu/Lark Messaging API
This is as a template, project owner to update This sample code can be tested using a Cisco dCloud demo instance that contains ** Insert Required Sandbox Components Here **
DNA Center Credentials: In order to use the DNA Center APIs, you need to make note of the IP address, username, and password of your instance of DNA Center. Note these values to add to the credentials file during the installation phase.
- Clone this repository with
git clone [repository name]
- Set up a Python virtual environment. Make sure Python 3 is installed in your environment, and if not, you may download Python here. Once Python 3 is installed in your environment, you can activate the virtual environment with the instructions found here.
- Install the requirements with
pip3 install -r requirements.txt
- Update the service now host details in
.env
file.instructions on setting up custom bot in Feishu or Lark, please refer hereFEISHU_BOT_WEBHOOK_URL = https://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- To enable https:// for the application. The application may require ssl key and certificate files
to generate self-signed custom certificate using openssl, run the following command in terminal and provide asked parameters.
HTTPS_ENABLED = True CERT_PATH = cert.pem KEY_PATH = key.pem
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
For detailed instructions on setting up event webhook notification at cisco DNA center.
To run the code, use the command:
$ python3 app.py
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.