%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/states/ |
Current File : //lib/python2.7/site-packages/salt/states/msteams.pyo |
� ���^c @@ sQ d Z d d l m Z m Z m Z d d l m Z d � Z d d d d � Z d S( u Send a message card to Microsoft Teams ====================================== This state is useful for sending messages to Teams during state runs. .. versionadded:: 2017.7.0 .. code-block:: yaml teams-message: msteams.post_card: - message: 'This state was executed successfully.' - hook_url: https://outlook.office.com/webhook/837 The hook_url can be specified in the master or minion configuration like below: .. code-block:: yaml msteams: hook_url: https://outlook.office.com/webhook/837 i ( t absolute_importt print_functiont unicode_literals( t SaltInvocationErrorc C@ s d t k r d St S( uB Only load if the msteams module is available in __salt__ u msteams.post_cardu msteams( t __salt__t False( ( ( s7 /usr/lib/python2.7/site-packages/salt/states/msteams.pyt __virtual__ s c C@ s i | d 6i d 6t d 6d d 6} t d rM d j | � | d <d | d <| S| sj d j | � | d <| Sy) t d d | d | d | d | � } Wn) t k r� } d j | | � | d <nP Xt | t � r� | r� t | d <d j | � | d <n d j | d | � | d <| S( u� Send a message to a Microsft Teams channel .. code-block:: yaml send-msteams-message: msteams.post_card: - message: 'This state was executed successfully.' - hook_url: https://outlook.office.com/webhook/837 The following parameters are required: message The message that is to be sent to the MS Teams channel. The following parameters are optional: hook_url The webhook URL given configured in Teams interface, if not specified in the configuration options of master or minion. title The title for the card posted to the channel theme_color A hex code for the desired highlight color u nameu changesu resultu u commentu testu1 The following message is to be sent to Teams: {0}u Teams message is missing: {0}u msteams.post_cardt messaget hook_urlt titlet theme_coloru! Failed to send message ({0}): {1}u Sent message: {0}u messageN( R t __opts__t formatt NoneR R t isinstancet boolt True( t nameR R R R t rett resultt sie( ( s7 /usr/lib/python2.7/site-packages/salt/states/msteams.pyt post_card'