Slack Notifier¶
A tool for sending notifications to Slack channels.
To use in an API class, follow the standard convention accessing the
tools
property that Sermos injects.
Example:
class DemoApiClass(object):
def post(self):
TODO: Example
To use in a worker method, follow the standard convention accessing the
tools
argument that Sermos injects.
Example:
def demo_worker_task(event, tools):
TODO: Example
-
class
sermos_tools.catalog.slack_notifier.slack_notifier.
SlackNotifier
(channels: List[str] = [], slack_webhook_url: str = '', slack_upload_url: str = 'https://slack.com/api/files.upload', token: str = '')¶ Helper to interact with Slack’s API
TODO: This needs work to be more logical / operate more seamlessly for both files and messages.
Usage:
notifier = SlackNotifier() # If Env variables set, nothing else needed notifier.send_message('Hello world!')