Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Action creation fails with 500 server error #215

Open
hovhanns opened this issue Jan 31, 2020 · 1 comment
Open

[BUG] Action creation fails with 500 server error #215

hovhanns opened this issue Jan 31, 2020 · 1 comment
Assignees
Labels

Comments

@hovhanns
Copy link

hovhanns commented Jan 31, 2020

**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
Copy link

I'm experiencing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants