File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/statuspage.cpython-310.pyc
Back
o ;j�: � @ s� d Z ddlZzddlZdZW n ey dZY nw dZe�e�ZdZ dZ g d�Zedd� Zd d d�Z dd � Zdd� Zd"dd�Zdd� Zdd� Zd#dd�Z d$dd�Z d$dd�Z d%dd�Z d%d d!�ZdS )&aM StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> page_id: <PAGE_ID> .. versionadded:: 2017.7.0 � NTF� statuspagezhttps://api.statuspage.io� )�idZ created_atZ updated_at�page_id�� �� )�POST�DELETEc C s t du rdS tS )z2 Return the execution module virtualname. F)Fz,The requests python package is not installed)�HAS_REQUESTS�__virtualname__� r r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/statuspage.py�__virtual__: s r c C s dddd�S )z& Default dictionary returned. F� N)�result�comment�outr r r r r �_default_retC s r c C sR t d d�}|s i }| p|�d�pt|p|�d�|p|�d�|p&|�d�p&td�S )z7 Retrieve the API params from the config file. z config.getr �api_urlr �api_key�api_version)r �api_page_idr r )Z__salt__�get�BASE_URL�DEFAULT_VERSION)r r r r Zstatuspage_cfgr r r �_get_api_paramsJ s ��r c C s( t | d tftf�ot | d tftf�S )zB Validate the API params as specified in the config file. r r )� isinstance�str��paramsr r r �_validate_api_params[ s �r c C s ddj | d d�iS )z' Return HTTP headers required. Z Authorizationz OAuth {oauth}r )Zoauth)�formatr r r r �_get_headerse s r"