%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlmZyddlZe	Z
Wnek
rmeZ
nXej
e�Zd�Zd�Zd�Zd�Zd	�Zd
�ZdS(u5
Wrapper around uptime API
=========================
i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionErrorcC@str
dStdfS(uJ
    Only load this module if the requests python module is available
    uuptimeu6uptime module needs the python requests module to work(tENABLEDtFalse(((s7/usr/lib/python2.7/site-packages/salt/modules/uptime.pyt__virtual__scK@s�t|�r7dj|�}tj|�t|��nt�}tjd�|jd|�tj	dj|�d|�}|j
s�tdj|j���ntjd�|j�dS(	uPCreate 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

    u0Trying to create check that already exists : {0}uptime] trying PUT requestturlu{0}/api/checkstdataurequest to uptime failed : {0}u[uptime] PUT request successfulu_id(
tcheck_existstformattlogterrorRt_get_application_urltdebugtupdatetrequeststputtoktreasontjson(tnametparamstmsgtapplication_urltreq((s7/usr/lib/python2.7/site-packages/salt/modules/uptime.pytcreate s
	
	
cC@s�t|�s7dj|�}tj|�t|��nt�}tjd�tjdj|��j	�}g|D] }|d|krr|d^qrd}tj
dj||��}|js�tdj|j���ntjd	�t
S(
u�
    Delete a check on a given URL

    CLI Example:

    .. code-block:: bash

        salt '*' uptime.delete http://example.org
    u0Trying to delete check that doesn't exists : {0}u[uptime] trying DELETE requestu{0}/api/checksuurlu_idiu{0}/api/checks/{1}urequest to uptime failed : {0}u"[uptime] DELETE request successful(R	R
RRRR
RRtgetRtdeleteRRtTrue(RRRtjcontenttxturl_idR((s7/usr/lib/python2.7/site-packages/salt/modules/uptime.pyR?s

	
1	
cC@s<tdd�}|dkr8tjd�td��n|S(u<
    Helper function to get application url from pillar
    u
pillar.getuuptime:application_urlu,Could not load uptime:application_url pillaru<uptime:application_url pillar is required for authenticationN(t__salt__tNoneRRR(R((s7/usr/lib/python2.7/site-packages/salt/modules/uptime.pyR
Zs
cC@sOt�}tjd�tjdj|��j�}g|D]}|d^q;S(uu
    List URL checked by uptime

    CLI Example:

    .. code-block:: bash

        salt '*' uptime.checks_list
    u[uptime] get checksu{0}/api/checksuurl(R
RRRRR
R(RRR((s7/usr/lib/python2.7/site-packages/salt/modules/uptime.pytchecks_listgs
	
cC@s'|t�kr#tjd|�tStS(u�
    Check if a given URL is in being monitored by uptime

    CLI Example:

    .. code-block:: bash

        salt '*' uptime.check_exists http://example.org
    uptime] found %s in checks(R#RRRR(R((s7/usr/lib/python2.7/site-packages/salt/modules/uptime.pyR	ws
(t__doc__t
__future__RRRtloggingtsalt.exceptionsRRRRtImportErrorRt	getLoggert__name__RRRRR
R#R	(((s7/usr/lib/python2.7/site-packages/salt/modules/uptime.pyt<module>s


					
	

Zerion Mini Shell 1.0