HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/http.cpython-310.pyc
o

�N�g�@s@dZddlZddlZddlmZdd�Zddd�Zdd	d
�ZdS)
z�
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.

.. versionadded:: 2015.5.0
�N)�CommandExecutionErrorc
Ksft��}d|vr|�|d�|d=ztjjjd||d�|��WSty2}ztt	|���d}~ww)a�
    .. versionadded:: 2015.5.0

    Query a resource, and decode the return data

    Passes through all the parameters described in the
    :py:func:`utils.http.query function <salt.utils.http.query>`:

    .. autofunction:: salt.utils.http.query

    raise_error : True
        If ``False``, and if a connection cannot be made, the error will be
        suppressed and the body of the return will simply be ``None``.

    CLI Example:

    .. code-block:: bash

        salt '*' http.query http://somelink.com/
        salt '*' http.query http://somelink.com/ method=POST             params='{"key1": "val1", "key2": "val2"}'
        salt '*' http.query http://somelink.com/ method=POST             data='<xml>somecontent</xml>'
    �opts)�urlrN�)
�__opts__�copy�update�salt�utils�http�query�	Exceptionr�str)r�kwargsr�excrr�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/http.pyrs��r�,c
Ks�t��}	d}d}ztdd|i|��}|�d�s |�d�s |WSWnty5}z|}WYd}~nd}~wwt��||krF|sD|rD|�|Sd|vrQt�|d�q)z�
    Query a resource until a successful response, and decode the return data

    CLI Example:

    .. code-block:: bash

        salt '*' http.wait_for_successful_query http://somelink.com/ wait_for=160 request_interval=1
    TNr�Error�errorZrequest_intervalr)�timer�getr
�sleep)r�wait_forrZ	starttimeZcaught_exception�resultrrrr�wait_for_successful_query2s(����rcCs@|durtddd�}|durtddd�}tjj�||t|�S)ab
    Update the local CA bundle file from a URL

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' http.update_ca_bundle
        salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
        salt '*' http.update_ca_bundle source=https://example.com/cacerts.pem

    If the ``target`` is not specified, it will be pulled from the ``ca_cert``
    configuration variable available to the minion. If it cannot be found there,
    it will be placed at ``<<FILE_ROOTS>>/cacerts.pem``.

    If the ``source`` is not specified, it will be pulled from the
    ``ca_cert_url`` configuration variable available to the minion. If it cannot
    be found, it will be downloaded from the cURL website, using an http (not
    https) URL. USING THE DEFAULT URL SHOULD BE AVOIDED!

    ``merge_files`` may also be specified, which includes a string or list of
    strings representing a file or files to be appended to the end of the CA
    bundle, once it is downloaded.

    CLI Example:

    .. code-block:: bash

        salt '*' http.update_ca_bundle merge_files=/path/to/mycert.pem
    Nz
config.getZ	ca_bundleZ
ca_bundle_url)Z__salt__r	r
r�update_ca_bundler)�target�sourceZmerge_filesrrrrTs
!r)r)NNN)	�__doc__rZsalt.utils.httpr	Zsalt.exceptionsrrrrrrrr�<module>s
$"