%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/mattermost.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	m
Z
eje�Z
dZd�Zd�Zd�Zd	�Zd
�Zddddd�ZdS(u�
Module for sending messages to Mattermost

.. versionadded:: 2017.7.0

:configuration: This module can be used by either passing an api_url and hook
    directly or by specifying both in a configuration profile in the salt
    master/minion config. For example:

    .. code-block:: yaml

        mattermost:
          hook: peWcBiMOS9HrZG15peWcBiMOS9HrZG15
          api_url: https://example.com
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationErroru
mattermostcC@stS(uZ
    Return virtual name of the module.

    :return: The virtual name of the module.
    (t__virtualname__(((s;/usr/lib/python2.7/site-packages/salt/modules/mattermost.pyt__virtual__ scC@s9tdd�ptdd�}|s5td��n|S(up
    Retrieves and return the Mattermost's configured hook

    :return:            String: the hook string
    u
config.getumattermost.hookumattermost:hookuNo Mattermost Hook found(t__salt__R(thook((s;/usr/lib/python2.7/site-packages/salt/modules/mattermost.pyt	_get_hook)s
cC@s9tdd�ptdd�}|s5td��n|S(uv
    Retrieves and return the Mattermost's configured api url

    :return:            String: the api url string
    u
config.getumattermost.api_urlumattermost:api_urluNo Mattermost API URL found(RR(tapi_url((s;/usr/lib/python2.7/site-packages/salt/modules/mattermost.pyt_get_api_url7s
cC@s$tdd�ptdd�}|S(uk
    Retrieves the Mattermost's configured channel

    :return:            String: the channel string
    u
config.getumattermost.channelumattermost:channel(R(tchannel((s;/usr/lib/python2.7/site-packages/salt/modules/mattermost.pyt_get_channelEscC@s$tdd�ptdd�}|S(um
    Retrieves the Mattermost's configured username

    :return:            String: the username string
    u
config.getumattermost.usernameumattermost:username(R(tusername((s;/usr/lib/python2.7/site-packages/salt/modules/mattermost.pyt
_get_usernameQscC@s|st�}n|s$t�}n|s6t�}n|sHt�}n|s^tjd�nt�}|rz||d<n|r�||d<nd|d|d<tjd|�td�j	t
jjj
|��}t
jjjd|d	|d
|�}t|�S(uD
    Send a message to a Mattermost channel.

    :param channel:     The channel name, either will work.
    :param username:    The username of the poster.
    :param message:     The message to send to the Mattermost channel.
    :param api_url:     The Mattermost api url, if not specified in the configuration.
    :param hook:        The Mattermost hook, if not specified in the configuration.
    :return:            Boolean if message was sent successfully.

    CLI Example:

    .. code-block:: bash

        salt '*' mattermost.post_message message='Build is done'
    umessage is a required option.uchanneluusernameu```utextuParameters: %supayload={0}R	Rtdata(R
RRRtlogterrortdicttdebugtstrtformattsalttutilstjsontdumpst
mattermosttquerytbool(tmessageRR
R	Rt
parametersRtresult((s;/usr/lib/python2.7/site-packages/salt/modules/mattermost.pytpost_message]s(	

$$(t__doc__t
__future__RRRtloggingtsalt.utils.jsonRtsalt.utils.mattermosttsalt.exceptionsRt	getLoggert__name__RRRRR
RRtNoneR (((s;/usr/lib/python2.7/site-packages/salt/modules/mattermost.pyt<module>s 						


Zerion Mini Shell 1.0