Ryan Qiu
01/09/2025, 2:48 AMMarvin
01/09/2025, 2:48 AMmatch
and match_related
fields to define your filter conditions. These fields allow you to filter events based on the contents of their resource
and related
fields. Each label added to a match
filter is combined using an AND operation, and can accept either a single value or a list of values that are combined using an OR operation.
For more details on how to configure these filters, you can refer to the Prefect documentation on custom triggers.
If you're looking for a specific SDK function to retrieve events based on these filters, you may need to explore the Prefect API further or implement a custom solution using these filtering capabilities.Ryan Qiu
01/09/2025, 2:57 AMRyan Qiu
01/09/2025, 2:58 AMMarvin
01/09/2025, 2:58 AMPOST /api/events/filter
endpoint. However, Prefect provides a general client interface, get_client
, that you might use to interact with the Prefect API programmatically.
Here's a basic idea of how you might use the client to interact with the API:
python
from prefect import get_client
async def filter_events(payload):
async with get_client() as client:
response = await <http://client.post|client.post>("/api/events/filter", json=payload)
return response.json()
# Example usage
# asyncio.run(filter_events(your_payload))
You would need to replace your_payload
with the appropriate JSON payload for your filtering conditions.
For more information about events and how they can be managed, you can check the Prefect documentation on events.