flytekit.core.notification
Notifications are primarily used when defining Launch Plans (also can be used when launching executions) and will trigger the Flyte platform to send emails when a workflow run reaches certain stages (fails or succeeds, etc.).
Each notification type takes a list of flytekit.models.core.execution.WorkflowExecutionPhase and a list of
emails. Even though there are different notification classes in this module, they all just send email. The differentiation
offers semantic meaning to the end-user but do not functionally behave differently. Successful integration with Slack
and Pagerduty is incumbent on those email API being set-up correctly.
Directory
Classes
| Class | Description |
|---|---|
Email |
This notification should be used when sending regular emails to people. |
Notification |
|
PagerDuty |
This notification should be used when sending emails to the PagerDuty service. |
Slack |
This notification should be used when sending emails to the Slack. |
flytekit.core.notification.Email
This notification should be used when sending regular emails to people.
from flytekit.models.core.execution import WorkflowExecutionPhase
Email(phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=["[email protected]"])class Email(
phases: typing.List[int],
recipients_email: typing.List[str],
)| Parameter | Type | Description |
|---|---|---|
phases |
typing.List[int] |
|
recipients_email |
typing.List[str] |
Methods
| Method | Description |
|---|---|
from_flyte_idl() |
|
serialize_to_string() |
|
short_string() |
:rtype: Text. |
to_flyte_idl() |
:rtype: flyteidl. |
from_flyte_idl()
def from_flyte_idl(
p,
)| Parameter | Type | Description |
|---|---|---|
p |
serialize_to_string()
def serialize_to_string()short_string()
def short_string():rtype: Text
to_flyte_idl()
def to_flyte_idl():rtype: flyteidl.admin.common_pb2.Notification
Properties
| Property | Type | Description |
|---|---|---|
email |
:rtype: EmailNotification |
|
is_empty |
||
pager_duty |
:rtype: PagerDutyNotification |
|
phases |
A list of phases to which users can associate the notifications. :rtype: list[int] |
|
slack |
:rtype: SlackNotification |
flytekit.core.notification.Notification
class Notification(
phases: typing.List[int],
email: flytekit.models.common.EmailNotification,
pager_duty: flytekit.models.common.PagerDutyNotification,
slack: flytekit.models.common.SlackNotification,
)| Parameter | Type | Description |
|---|---|---|
phases |
typing.List[int] |
|
email |
flytekit.models.common.EmailNotification |
|
pager_duty |
flytekit.models.common.PagerDutyNotification |
|
slack |
flytekit.models.common.SlackNotification |
Methods
| Method | Description |
|---|---|
from_flyte_idl() |
|
serialize_to_string() |
|
short_string() |
:rtype: Text. |
to_flyte_idl() |
:rtype: flyteidl. |
from_flyte_idl()
def from_flyte_idl(
p,
)| Parameter | Type | Description |
|---|---|---|
p |
serialize_to_string()
def serialize_to_string()short_string()
def short_string():rtype: Text
to_flyte_idl()
def to_flyte_idl():rtype: flyteidl.admin.common_pb2.Notification
Properties
| Property | Type | Description |
|---|---|---|
email |
:rtype: EmailNotification |
|
is_empty |
||
pager_duty |
:rtype: PagerDutyNotification |
|
phases |
A list of phases to which users can associate the notifications. :rtype: list[int] |
|
slack |
:rtype: SlackNotification |
flytekit.core.notification.PagerDuty
This notification should be used when sending emails to the PagerDuty service.
from flytekit.models.core.execution import WorkflowExecutionPhase
PagerDuty(phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=["[email protected]"])class PagerDuty(
phases: typing.List[int],
recipients_email: typing.List[str],
)| Parameter | Type | Description |
|---|---|---|
phases |
typing.List[int] |
|
recipients_email |
typing.List[str] |
Methods
| Method | Description |
|---|---|
from_flyte_idl() |
|
serialize_to_string() |
|
short_string() |
:rtype: Text. |
to_flyte_idl() |
:rtype: flyteidl. |
from_flyte_idl()
def from_flyte_idl(
p,
)| Parameter | Type | Description |
|---|---|---|
p |
serialize_to_string()
def serialize_to_string()short_string()
def short_string():rtype: Text
to_flyte_idl()
def to_flyte_idl():rtype: flyteidl.admin.common_pb2.Notification
Properties
| Property | Type | Description |
|---|---|---|
email |
:rtype: EmailNotification |
|
is_empty |
||
pager_duty |
:rtype: PagerDutyNotification |
|
phases |
A list of phases to which users can associate the notifications. :rtype: list[int] |
|
slack |
:rtype: SlackNotification |
flytekit.core.notification.Slack
This notification should be used when sending emails to the Slack.
from flytekit.models.core.execution import WorkflowExecutionPhase
Slack(phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=["[email protected]"])class Slack(
phases: typing.List[int],
recipients_email: typing.List[str],
)| Parameter | Type | Description |
|---|---|---|
phases |
typing.List[int] |
|
recipients_email |
typing.List[str] |
Methods
| Method | Description |
|---|---|
from_flyte_idl() |
|
serialize_to_string() |
|
short_string() |
:rtype: Text. |
to_flyte_idl() |
:rtype: flyteidl. |
from_flyte_idl()
def from_flyte_idl(
p,
)| Parameter | Type | Description |
|---|---|---|
p |
serialize_to_string()
def serialize_to_string()short_string()
def short_string():rtype: Text
to_flyte_idl()
def to_flyte_idl():rtype: flyteidl.admin.common_pb2.Notification
Properties
| Property | Type | Description |
|---|---|---|
email |
:rtype: EmailNotification |
|
is_empty |
||
pager_duty |
:rtype: PagerDutyNotification |
|
phases |
A list of phases to which users can associate the notifications. :rtype: list[int] |
|
slack |
:rtype: SlackNotification |