Skip to content

Commit

Permalink
Merge pull request #32 from trendmicro/feature/alert-filter
Browse files Browse the repository at this point in the history
Add alert filter support to consume
  • Loading branch information
t0mz06 authored Oct 25, 2024
2 parents 38d00ef + 1f9de5a commit 24d8a24
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pytmv1/api/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def consume(
consumer: Callable[[Union[SaeAlert, TiAlert]], None],
start_time: Optional[str] = None,
end_time: Optional[str] = None,
op: QueryOp = QueryOp.AND,
**fields: str,
) -> Result[ConsumeLinkableResp]:
"""Retrieves and consume workbench alerts.
Expand All @@ -134,6 +136,11 @@ def consume(
time range (yyyy-MM-ddThh:mm:ssZ).
Defaults to the time the request is made.
:type end_time: Optional[str]
:param op: Operator to apply between fields (ie: ... OR ...).
:type op: QueryOp
:param fields: Field/value used to filter result (i.e:fileName="1.sh"),
check Vision One API documentation for full list of supported fields.
:type fields: Dict[str, str]
:rtype: Result[ConsumeLinkableResp]:
"""
return self._core.send_linkable(
Expand All @@ -147,4 +154,5 @@ def consume(
"orderBy": "createdDateTime desc",
}
),
headers=utils.tmv1_filter(op, fields),
)

0 comments on commit 24d8a24

Please sign in to comment.