prefect.server.events.clients

Classes

EventsClient

The abstract interface for a Prefect Events client Methods:

emit

emit(self, event: Event) -> Optional[Event]

NullEventsClient

A no-op implementation of the Prefect Events client for testing Methods:

client_name

client_name(self) -> str

emit

emit(self, event: Event) -> None

emit

emit(self, event: Event) -> None
Emit a single event

AssertingEventsClient

An implementation of the Prefect Events client that records all events sent to it for inspection during tests. Methods:

assert_emitted_event_count

assert_emitted_event_count(cls, count: int) -> None
Assert that the given number of events were emitted.

assert_emitted_event_with

assert_emitted_event_with(cls, event: Optional[str] = None, resource: Optional[Dict[str, LabelValue]] = None, related: Optional[List[Dict[str, LabelValue]]] = None, payload: Optional[Dict[str, Any]] = None) -> None
Assert that an event was emitted containing the given properties.

assert_no_emitted_event_with

assert_no_emitted_event_with(cls, event: Optional[str] = None, resource: Optional[Dict[str, LabelValue]] = None, related: Optional[List[Dict[str, LabelValue]]] = None, payload: Optional[Dict[str, Any]] = None) -> None

client_name

client_name(self) -> str

emit

emit(self, event: Event) -> Event

emit

emit(self, event: Event) -> None
Emit a single event

emitted_events_count

emitted_events_count(cls) -> int

reset

reset(cls) -> None
Reset all captured instances and their events. For use this between tests

PrefectServerEventsClient

Methods:

client_name

client_name(self) -> str

emit

emit(self, event: Event) -> ReceivedEvent

emit

emit(self, event: Event) -> None
Emit a single event

PrefectServerEventsAPIClient

Methods:

pause_automation

pause_automation(self, automation_id: UUID) -> httpx.Response

resume_automation

resume_automation(self, automation_id: UUID) -> httpx.Response