%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/msteams.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlm	Z	ddl
Zeje�Z
dZd�Zd�Zdddd�ZdS(	uU
Module for sending messages to MS Teams

.. versionadded:: 2017.7.0

:configuration: This module can be used by either passing a hook_url
    directly or by specifying it in a configuration profile in the salt
    master/minion config. For example:

.. code-block:: yaml

    msteams:
      hook_url: https://outlook.office.com/webhook/837
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationErrorumsteamscC@stS(uY
    Return virtual name of the module.
    :return: The virtual name of the module.
    (t__virtualname__(((s8/usr/lib/python2.7/site-packages/salt/modules/msteams.pyt__virtual__ scC@s9tdd�ptdd�}|s5td��n|S(uK
    Return hook_url from minion/master config file
    or from pillar
    u
config.getumsteams.hook_urlumsteams:hook_urluNo MS Teams hook_url found.(t__salt__R(thook_url((s8/usr/lib/python2.7/site-packages/salt/modules/msteams.pyt
_get_hook_url(s
cC@s�|st�}n|s(tjd�ni|d6|d6|d6}tjjj|dddtjjj|�dt	�}|d	d
kr�t	Sit
d6|jd|d	�d
6SdS(u�
    Send a message to an MS Teams channel.
    :param message:     The message to send to the MS Teams channel.
    :param hook_url:    The Teams webhook URL, if not specified in the configuration.
    :param title:       Optional title for the posted card
    :param theme_color:  Optional hex color highlight for the posted card
    :return:            Boolean if message was sent successfully.

    CLI Example:

    .. code-block:: bash

        salt '*' msteams.post_card message="Build is done"
    umessage is a required option.utextutitleu
themeColortmethoduPOSTtdatatstatusustatusi�uresubodyumessageN(RtlogterrortsalttutilsthttptquerytjsontdumpstTruetFalsetget(tmessageRttitlettheme_colortpayloadtresult((s8/usr/lib/python2.7/site-packages/salt/modules/msteams.pyt	post_card6s"
	(t__doc__t
__future__RRRtloggingtsalt.utils.jsonRtsalt.exceptionsRtsalt.ext.six.moves.http_clientt	getLoggert__name__RRRRtNoneR(((s8/usr/lib/python2.7/site-packages/salt/modules/msteams.pyt<module>s		

Zerion Mini Shell 1.0