mattermost

Module for sending messages to Mattermost

Important

You can optionally add a configuration profile to avoid having to pass hook and api_url to each invocation.

saltext.mattermost.runners.mattermost.post_message(message, channel=None, username=None, api_url=None, hook=None)[source]

Send a message to a Mattermost channel.

Parameters:
  • channel – The channel name, either will work.

  • username – The username of the poster.

  • message – The message to send to the Mattermost channel.

  • api_url – The Mattermost api url, if not specified in the configuration.

  • hook – The Mattermost hook, if not specified in the configuration.

Returns:

Boolean if message was sent successfully.

CLI Example:

salt-run mattermost.post_message message='Build is done'
saltext.mattermost.runners.mattermost.post_event(event, channel=None, username=None, api_url=None, hook=None)[source]

Send an event to a Mattermost channel.

Parameters:
  • channel – The channel name, either will work.

  • username – The username of the poster.

  • event – The event to send to the Mattermost channel.

  • api_url – The Mattermost api url, if not specified in the configuration.

  • hook – The Mattermost hook, if not specified in the configuration.

Returns:

Boolean if message was sent successfully.