Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from fastapi_users import FastAPIUsers
from beanie import PydanticObjectId
from pydantic import BaseModel
from kernelci.api.models import (

Check failure on line 39 in api/main.py

View workflow job for this annotation

GitHub Actions / Lint

Unable to import 'kernelci.api.models'
Node,
Hierarchy,
PublishEvent,
Expand Down Expand Up @@ -484,6 +484,7 @@
- from: Start timestamp (unix epoch) to filter events
- kind: Event kind to filter events
- state: Event state to filter events
- result: Event result to filter events
- recursive: Retrieve node together with event
This API endpoint is under development and may change in future.
"""
Expand All @@ -493,6 +494,7 @@
limit = query_params.pop('limit', None)
kind = query_params.pop('kind', None)
state = query_params.pop('state', None)
result = query_params.pop('result', None)
from_ts = query_params.pop('from', None)
if from_ts:
if isinstance(from_ts, str):
Expand All @@ -502,6 +504,8 @@
query_params['data.kind'] = kind
if state:
query_params['data.state'] = state
if result:
query_params['data.result'] = result
if limit:
query_params['limit'] = int(limit)
resp = await db.find_by_attributes_nonpaginated(EventHistory, query_params)
Expand Down