File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/proxy/__pycache__/restconf.cpython-310.pyc
Back
o ;j� � @ s� d Z ddlZddlZddlZddlZddlmZ dgZdZ e� e�Zi Z dd� Zdd� Zd d � Zdd� Zd d� Zdd� Zddd�ZdS )a� Proxy Minion to manage RESTCONF Devices :codeauthor: Jamie (Bear) Murphy <jamiemurphyit@gmail.com> :maturity: new :platform: any Usage ===== .. note:: To be able to use this module you need to enable RESTCONF on your device and have https enabled. Cisco Configuration example: .. code-block:: bash switch# conf t switch(config)# restconf switch(config)# ip http secure-server .. note:: RESTCONF requires modern OS distributions. This plugin has been written specifically to use JSON RESTCONF endpoints Pillar ------ The ``restconf`` proxy configuration requires the following parameters in order to connect to the network switch: transport: ``https`` (str) Specifies the type of connection transport to use. Valid values for the connection are ``https``, and ``http``. The RESTCONF standard explicitly requires https, but http is included as an option as some manufacturers have ignored this requirement. hostname: (str) The IP address or DNS host name of the RESTCONF device. username: (str) The username for the device to authenticate the RESTCONF requests. password: (str) The password for the device to authenticate the RESTCONF requests. verify: ``True`` or ``False`` (str, optional, default:true) Verify the RESTCONF SSL certificate? When there is no certificate configuration on the device and this option is set as ``True`` (default), the commands will fail with the following error: ``SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed``. .. warning:: In this case, you either need to configure a proper certificate on the device (*recommended*), or bypass the checks setting this argument as ``False`` with all the security risks considered as you may be MITM'd. Proxy Pillar Example -------------------- .. code-block:: yaml proxy: proxytype: restconf host: switch1.example.com username: example password: example verify: false � N)� SaltExceptionZrestconfc C s t S )zV This Proxy Module is widely available as there are no external dependencies. )�__virtualname__� r r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/proxy/restconf.py�__virtual__h s r c C s t �d� t�| �di ��}|�dd�| d<