An in-memory Blacklisting Service using Django framework.
Refer this website for API Usage [Site Under Construction]
- Docker (Please see the documentation)
- Python3
docker build -t blacklisting .
docker run -p 8080:8080 blacklisting
The above commands start the server in port 8080
pip install -r requirements.txt
cd blacklisting
python manage.py runserver
Lists all the IPv4 address from DB
Request
curl -XGET 'localhost:8000/v1/blacklist'
Response
HTTP/1.1 200 OK
{"all_ip": ["192.168.97.10", "192.168.98.10", "192.168.08.58", "192.168.0.2", "192.168.0.25"]}
Request
curl -XPOST 'localhost:8000/v1/blacklist' \
--header 'Content-Type: application/json' \
--data-raw '"{\"ip\" : \"192.168.0.3\"}"'
Response
HTTP/1.1 201 Created
Request
curl -XDELETE 'localhost:8000/v1/blacklist' \
--header 'Content-Type: application/json' \
--data-raw '"{\"ip\" : \"192.168.0.3\"}"'
Response
HTTP/1.1 200 OK
curl -XDELETE localhost:8000/v1/blacklist
--body '{"ip":"192.168.92.68"}'
/**
*
* @author Rakesh Kumar T
* @github rakesht2499
*
*/