%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/modules/ |
Current File : //lib/python2.7/site-packages/salt/modules/http.pyo |
� ���^c @@ se d Z d d l m Z m Z m Z d d l Z d d l Z d � Z d d � Z d d d d � Z d S( u� Module for making various web calls. Primarily designed for webhooks and the like, but also useful for basic http testing. .. versionadded:: 2015.5.0 i ( t absolute_importt print_functiont unicode_literalsNc K@ sR t j � } d | k r3 | j | d � | d =n t j j j d | d | | � S( u Query a resource, and decode the return data Passes through all the parameters described in the :py:func:`utils.http.query function <salt.utils.http.query>`: .. autofunction:: salt.utils.http.query CLI Example: .. code-block:: bash salt '*' http.query http://somelink.com/ salt '*' http.query http://somelink.com/ method=POST params='key1=val1&key2=val2' salt '*' http.query http://somelink.com/ method=POST data='<xml>somecontent</xml>' u optst urlt opts( t __opts__t copyt updatet saltt utilst httpt query( R t kwargsR ( ( s5 /usr/lib/python2.7/site-packages/salt/modules/http.pyR s i, c K@ s� t j � } x� t r� d } d } y: t d | | � } | j d � rZ | j d � rZ | SWn t k rv } | } n Xt j � | | k r | r� | r� | � n | Sq Wd S( u� Query a resource until a successful response, and decode the return data CLI Example: .. code-block:: bash salt '*' http.wait_for_successful_query http://somelink.com/ wait_for=160 R u Erroru errorN( t timet Truet NoneR t gett Exception( R t wait_forR t starttimet caught_exceptiont resultt exc( ( s5 /usr/lib/python2.7/site-packages/salt/modules/http.pyt wait_for_successful_query, s c C@ s` | d k r"