prefect.events
¶
Event
¶
Bases: PrefectBaseModel
The client-side view of an event that has happened to a Resource
Source code in prefect/events/schemas.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
RelatedResource
¶
Bases: Resource
A Resource with a specific role in an Event
Source code in prefect/events/schemas.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
Resource
¶
Bases: Labelled
An observable business object of interest to the user
Source code in prefect/events/schemas.py
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 89 |
|
emit_event
¶
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[DateTimeTZ]
|
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 prefect/events/utilities.py
16 17 18 19 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 |
|