salt.proxy.arista_pyeapi

Arista pyeapi

New in version 2019.2.0.

Proxy module for managing Arista switches via the eAPI using the pyeapi 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

proxy:
  proxytype: pyeapi
  host: router1.example.com
  username: example
  password: example
salt.proxy.arista_pyeapi.call(method, *args, **kwargs)

Calls an arbitrary pyeapi method.

salt.proxy.arista_pyeapi.conn()

Return the connection object.

salt.proxy.arista_pyeapi.init(opts)

Open the connection to the Arista switch over the eAPI.

salt.proxy.arista_pyeapi.initialized()

Connection finished initializing?

salt.proxy.arista_pyeapi.ping()

Connection open successfully?

salt.proxy.arista_pyeapi.shutdown(opts)

Closes connection with the device.