Slack¶
This module requires an optional dependency. See Installation for details.
Slack Notifications¶
Tasks related to creation of Slack notifications
- tamr_toolbox.notifications.slack.send_message(*, slack_client, channel, message, raise_error=True, **kwargs)[source]¶
Sends a message to a pre-defined Slack channel
- Parameters
- Return type
- Returns
The data property of the Slack WebClient object
- Raises
SlackApiError – if the SlackClient does not post the message correctly and raise_error is set to True
- tamr_toolbox.notifications.slack.monitor_job(tamr, *, slack_client, channel, operation, poll_interval_seconds=1, timeout_seconds=None, notify_states=None)[source]¶
Monitors a Tamr Operation and sends a Slack message to a channel when the job status is updated
- Parameters
tamr (
Client
) – A Tamr clientslack_client (
WebClient
) – A Slack WebClientchannel (
str
) – A (public) Slack channel to receive messagesoperation (
Union
[int
,str
,Operation
]) – A job ID or a Tamr operationpoll_interval_seconds (
float
) – Time interval (in seconds) between subsequent pollstimeout_seconds (
Optional
[float
]) – Time (in seconds) to waitnotify_states (
Optional
[List
[OperationState
]]) – States for which notifications should be sent, use None for all states
- Return type
- Returns
A list of messages with their config sent via the Slack WebClient object