%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/utils/ |
| Current File : //proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/utils/mattermost.pyc |
�
���^c @@ s� d Z d d l m Z m Z d d l Z d d l m Z d d l Z d d l
m Z d d l Z d d l
m Z e j e � Z d d d d � Z d S( ud
Library for interacting with Mattermost Incoming Webhooks
:configuration: This module can be used by specifying the name of a
configuration profile in the minion config, minion pillar, or master
config.
For example:
.. code-block:: yaml
mattermost:
hook: 3tdgo8restnxiykdx88wqtxryr
api_url: https://example.com
i ( t absolute_importt unicode_literalsN( t urljoin( t __version__( t sixc C@ s^ d } i d d 6t d 6} t | d � } t | t j | � � } t j j j | | d | d t d t �} | j d d � t j
j j j j
k r� d
j | � | d <| S| j d d � t j
j j j j k r� t St j | � t j | � t j | � d | k rF| d } d | k r9| d | d <t | d <| Sd
| d <n d | d <t | d <| S( u3
Mattermost object method function to construct and execute on the API URL.
:param api_url: The Mattermost API URL
:param hook: The Mattermost hook.
:param data: The data to be sent for POST method.
:return: The json response from the API call or False.
u POSTu u messageu resu /hooks/t datat decodet statusu statusu Message posted {0} correctlyu dictu erroru Message not postedu invalid_authN( t Truet _urljoinR t text_typet saltt utilst httpt queryt gett Nonet extt movest http_clientt OKt formatt
NO_CONTENTt logt debugt False( t hookt api_urlR t methodt rett base_urlt urlt resultt _result( ( s9 /usr/lib/python2.7/site-packages/salt/utils/mattermost.pyR s8
''
( t __doc__t
__future__R R t loggingt salt.ext.six.moves.urllib.parseR R t salt.ext.six.moves.http_clientR t salt.versionR t salt.utils.httpt salt.extR t getLoggert __name__R R R ( ( ( s9 /usr/lib/python2.7/site-packages/salt/utils/mattermost.pyt <module> s