-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Description
**I am seeing this behaviour on: **
- OS: Ubuntu
- Carbon Black Product: CBResponse
- Python Version: 2.7
Describe the bug
CBapi uses the old version of API to create action for watchlist
POST /api/v1/watchlist//action
{
"action_type":3,
"watchlist_id":
}
this API is deprecated and throws internal server error
Steps to Reproduce
watchlist = cb_api.create(Watchlist, data={"name": name, "index_type": watchlist_type})
watchlist.query = search_query
watchlist.save()
alert_action = watchlist.create_action()
alert_action.action_type = 3 # Create alert on detection
alert_action.watchlist_id = watchlist.id
alert_action.save()
run this code, it raises exception
cbapi.errors.ServerError: Received error code 500 from API: Unhandled exception. Check logs for details.
Expected behavior
Should create alert action without error
Additional context
The part in the code need to changed
src/cbapi/response/models.py 471:473, here is used the deprecated REST api calls
nguyenl95