prefect.events.utilities
emit_event(event, resource, occurred=None, related=None, payload=None, id=None, follows=None)
Send an event to Prefect Cloud.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
str
|
The name of the event that happened. |
required |
resource
|
Dict[str, str]
|
The primary Resource this event concerns. |
required |
occurred
|
Optional[DateTime]
|
When the event happened from the sender's perspective. Defaults to the current datetime. |
None
|
related
|
Optional[Union[List[Dict[str, str]], List[RelatedResource]]]
|
A list of additional Resources involved in this event. |
None
|
payload
|
Optional[Dict[str, Any]]
|
An open-ended set of data describing what happened. |
None
|
id
|
Optional[UUID]
|
The sender-provided identifier for this event. Defaults to a random UUID. |
None
|
follows
|
Optional[Event]
|
The event that preceded this one. If the preceding event happened more than 5 minutes prior to this event the follows relationship will not be set. |
None
|
Returns:
Type | Description |
---|---|
Optional[Event]
|
The event that was emitted if worker is using a client that emit |
Optional[Event]
|
events, otherwise None |
Source code in src/prefect/events/utilities.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|