%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/proxy/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pyo

�
���^c@@s�dZddlmZmZmZddlZyddlZeZWne	k
r]e
ZnXyddlmZWn!e	k
r�ddl
mZnXdgZdZeje�ZiZd�Zd�Zd�Zd	�Zd
�Zd�Zd�ZdS(
u{
Arista pyeapi
=============

.. versionadded:: 2019.2.0

Proxy module for managing Arista switches via the eAPI using the
`pyeapi <http://pyeapi.readthedocs.io/en/master/index.html>`_ library.

:codeauthor: Mircea Ulinic <ping@mirceaulinic.net>
:maturity:   new
:depends:    pyeapi
:platform:   unix

.. note::

    To understand how to correctly enable the eAPI on your switch, please check
    https://eos.arista.com/arista-eapi-101/.


Dependencies
------------

The ``pyeapi`` Proxy module requires pyeapi to be installed:
``pip install pyeapi``.

Pillar
------

The ``pyeapi`` proxy configuration requires the following parameters in order
to connect to the network device:

transport: ``https``
    Specifies the type of connection transport to use. Valid values for the
    connection are ``socket``, ``http_local``, ``http``, and  ``https``.

host: ``localhost``
    The IP address or DNS host name of the connection device.

username: ``admin``
    The username to pass to the device to authenticate the eAPI connection.

password
    The password to pass to the device to authenticate the eAPI connection.

port
    The TCP port of the endpoint for the eAPI connection. If this keyword is
    not specified, the default value is automatically determined by the
    transport type (``80`` for ``http``, or ``443`` for ``https``).

enablepwd
    The enable mode password if required by the destination node.

All the arguments may be optional, depending on your setup.

Proxy Pillar Example
--------------------

.. code-block:: yaml

    proxy:
      proxytype: pyeapi
      host: router1.example.com
      username: example
      password: example
i(tabsolute_importtprint_functiontunicode_literalsN(tclean_kwargsupyeapicC@ststdfStS(u=
    Proxy module available only if pyeapi is installed.
    uDThe pyeapi proxy module requires the pyeapi library to be installed.(t
HAS_PYEAPItFalset__virtualname__(((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pyt__virtual__js
cC@s�|jdi�}|j�}|jdd�|jdt�|d<yUtjj|�}tjj|d|jd��}|t	d<tt	d<tt	d<Wn4tj
jk
r�}tj
d	|d
dt�tSXtS(
uA
    Open the connection to the Arista switch over the eAPI.
    uproxyu	proxytypeumultiprocessingt	enablepwdu	enablepwdu
connectionuinitializeduupuUnable to connect to %suhosttexc_infoN(tgettcopytpoptNonetTruetpyeapitclienttconnecttNodet
pyeapi_deviceteapilibtConnectionErrortlogterrorR(toptst
proxy_dictt	conn_argstconntnodetcerr((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pytinitws!

cC@stjdt�S(u'
    Connection open successfully?
    uup(RR
R(((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pytping�scC@stjdt�S(u+
    Connection finished initializing?
    uinitialized(RR
R(((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pytinitialized�scC@stjd|d�dS(u,
    Closes connection with the device.
    u(Shutting down the pyeapi Proxy Minion %suidN(Rtdebug(R((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pytshutdown�scC@s
tjd�S(u'
    Return the connection object.
    u
connection(RR
(((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pyR�scO@s&t|�}ttd|�||�S(u+
    Calls an arbitrary pyeapi method.
    u
connection(RtgetattrR(tmethodtargstkwargs((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pytcall�s(t__doc__t
__future__RRRtloggingRRRtImportErrorRtsalt.utils.argsRt
salt.utilst__proxyenabled__Rt	getLoggert__name__RRRRRR R"RR'(((s</usr/lib/python2.7/site-packages/salt/proxy/arista_pyeapi.pyt<module>Cs,



		
					

Zerion Mini Shell 1.0