File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/glassfish.cpython-310.pyc
Back
o ;j�M � @ s d Z ddlZddlZddlZddlmZ zddlZdZ W n e y' dZ Y nw dZdddddd �Zd d� Z dd � Zdd� Zdd� Zdd� Zdd� Zdd� Zdcdd�Zdcdd�Zdcdd�Zdcdd�Zdcd d!�Zddd"d#�Zdcd$d%�Zdcd&d'�Zdcd(d)�Zdcd*d+�Zdcd,d-�Zdcd.d/�Zdcd0d1�Z ded3d4�Z!dcd5d6�Z"dcd7d8�Z#dcd9d:�Z$dcd;d<�Z%dfd=d>�Z&dcd?d@�Z'dcdAdB�Z(dcdCdD�Z)dcdEdF�Z*dfdGdH�Z+dcdIdJ�Z,dcdKdL�Z-dcdMdN�Z.dcdOdP�Z/dgdQdR�Z0dcdSdT�Z1dcdUdV�Z2dcdWdX�Z3dcdYdZ�Z4dfd[d\�Z5dcd]d^�Z6dcd_d`�Z7dcdadb�Z8dS )hzp Module for working with the Glassfish/Payara 4.x management API .. versionadded:: 2016.11.0 :depends: requests � N)�CommandExecutionErrorTFZ glassfishZ localhosti� )�ssl�url�port�user�passwordc C s t rtS dd�t�fS )z, Only load if requests is installed FzAThe "{}" module could not be loaded: "requests" is not installed.)�HAS_LIBS�__virtualname__�format� r r �J/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/glassfish.py�__virtual__ s ��r c C s dddd�S )zV Return fixed dict with headers (JSON data + mandatory "Requested by" header) zapplication/jsonzGlassFish REST HTML interface)ZAcceptzContent-TypezX-Requested-Byr r r r r �_get_headers/ s �r c C s | r|rt j�| |�S dS )z& Returns the HTTP auth header N)�requests�authZ HTTPBasicAuth)�usernamer r r r � _get_auth: s r c C s0 | r d|� d|� d|� �S d|� d|� d|� �S )z) Returns the URL of the endpoint zhttps://�:z/management/domain/zhttp://r )r r r �pathr r r �_get_urlD s r c C s | r| S t S )zE Returns the server information if provided, or the defaults )�DEFAULT_SERVER��serverr r r �_get_serverN � r c C s"