Skip to content

Cannot retrieve alerts #14

@ryanjjung

Description

@ryanjjung

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions