cbapi-python
cbapi-python copied to clipboard
[BUG] Action creation fails with 500 server error
**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/
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
I'm experiencing the same issue