%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/modules/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/modules/uptime.pyc |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l m Z y d d l Z e Z
Wn e k
rm e Z
n Xe j
e � Z d � Z d � Z d � Z d � Z d � Z d
� Z d S( u5
Wrapper around uptime API
=========================
i ( t absolute_importt print_functiont unicode_literalsN( t CommandExecutionErrorc C@ s t r
d St d f S( uJ
Only load this module if the requests python module is available
u uptimeu6 uptime module needs the python requests module to work( t ENABLEDt False( ( ( s7 /usr/lib/python2.7/site-packages/salt/modules/uptime.pyt __virtual__ s c K@ s� t | � r7 d j | � } t j | � t | � � n t � } t j d � | j d | � t j d j | � d | �} | j
s� t d j | j � � � n t j d � | j � d S( uP Create a check on a given URL.
Additional parameters can be used and are passed to API (for
example interval, maxTime, etc). See the documentation
https://github.com/fzaninotto/uptime for a full list of the
parameters.
CLI Example:
.. code-block:: bash
salt '*' uptime.create http://example.org
u0 Trying to create check that already exists : {0}u [uptime] trying PUT requestt urlu {0}/api/checkst datau request to uptime failed : {0}u [uptime] PUT request successfulu _id(
t check_existst formatt logt errorR t _get_application_urlt debugt updatet requestst putt okt reasont json( t namet paramst msgt application_urlt req( ( s7 /usr/lib/python2.7/site-packages/salt/modules/uptime.pyt create s
c C@ s� t | � s7 d j | � } t j | � t | � � n t � } t j d � t j d j | � � j � } g | D] } | d | k rr | d ^ qr d } t j
d j | | � � } | j s� t d j | j � � � n t j d � t
S(
u�
Delete a check on a given URL
CLI Example:
.. code-block:: bash
salt '*' uptime.delete http://example.org
u0 Trying to delete check that doesn't exists : {0}u [uptime] trying DELETE requestu {0}/api/checksu urlu _idi u {0}/api/checks/{1}u request to uptime failed : {0}u"