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

Cannot retrieve alerts #14

Open
ryanjjung opened this issue Apr 13, 2018 · 0 comments
Open

Cannot retrieve alerts #14

ryanjjung opened this issue Apr 13, 2018 · 0 comments

Comments

@ryanjjung
Copy link

I'm using version 1.2.0 of this module:

$ pip freeze | grep threatstack
threatstack==1.2.0

I can run through the steps in the docs trying to get alerts, but I always wind up with an empty list. Something's wrong with the generator.

from datetime import datetime, timedelta
from threatstack import ThreatStack
api_key = 'my_api_key'
org_id = 'my_org_id'
user_id = 'my_user_id'
client = ThreatStack(api_key=api_key, org_id=org_id, user_id=user_id)
now = datetime.now()
yesterday = now - timedelta(days=1)
alerts = client.alerts.list(start=yesterday, end=now)
print([ alert for alert in alerts ])

The output:

[]

If I look in the web UI, I can see several alerts occurring in the past day. I should get more than an empty list here.

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

No branches or pull requests

1 participant