FastNetMon Advanced example API client to add and remove networks

Home FastNetMon Advanced Technical Documentation FastNetMon Advanced example API client to add and remove networks
Contents

To use this example, please enable the API using this guide and install the dependencies for it:

sudo apt-get install -y python3-requests

And then download fastnetmon_api_client.py file from GitHub:

wget https://raw.githubusercontent.com/FastNetMon/fastnetmon-example-api-client-python-networks/main/fastnetmon_api_client.py

Enable execution flag:

chmod +x fastnetmon_api_client.py

And run it this way:

./fastnetmon_api_client.py

Valid output looks like:

Add random network: 114.123.112.50/22
Correctly added new subnet
Networks list with new network: {u'values': [u'114.123.112.50/22'], u'error_text': u'', u'success': True}
Correctly removed new subnet