This example script can create a blackhole announce, list blocked hosts and remove them using UUID lookup.
To use this example, please enable the API using this guide and install the dependencies for it:
sudo apt-get install -y python3-requests
Then, download fastnetmon_api_client.py from GitHub:
wget https://raw.githubusercontent.com/FastNetMon/fastnetmon-example-api-client-python-blackhole/main/fastnetmon_api_client.py
Enable execution flag:
chmod +x fastnetmon_api_client.py
And run it in the following way:
./fastnetmon_api_client.py
Valid output looks as follows:
Blackhole IP: 127.0.0.197 Correctly blackholed IP Wait 5 second to propagate changes Correctly found UUID for this IP 2518758c-a751-4984-9aeb-c5a935422e91 Correctly removed blackhole announce

