In order to delete a blacklist entry, the REST API client must send an HTTP DELETE to the URI:
/api/oper/blacklist
The action can have the following parameters:
host - The host IP address to blacklist. (Required.)
service - The service associated with the entry. (Optional with a default value of all_services.)
As mentioned previously, a DELETE operation can only remove a blacklist entry that was previously added by the REST API. It cannot remove an entry that was added by a cOS Core feature such as IDP or threshold rules.
For example, to remove any entry with the IP address 203.0.113.5, send an HTTP DELETE to the URI:
/api/oper/blacklist?host=203.0.113.5
The Content-Type for this should be application/x-www-form-urlencoded.
The service parameter can be added to delete a previously added blacklist entry with a specific service. For example, to delete the entry with the IPv4 address 203.0.113.7 and service http-all. send a DELETE command to the following URI:
/api/oper/blacklist?host=203.0.113.5&service=http-all
The following JSON reply will be sent back by cOS Core if the deletion is successful:
{ "error": false }
Note that every blacklist entry has a service associated with it and the delete operation will only delete an entry that has an exact match with the specified combination of IP address and service. If the service parameter is specified as all_services (the default) then this would not delete an entry that has a service of http-all.