Pyeapi installation

Installation is straightforward with pip:

$ sudo pip install pyeapi
$ sudo pip3 install pyeapi
Note that pip will also install the netaddr library as it is part of the stated requirements (http://pyeapi.readthedocs.io/en/master/requirements.html) for Pyeapi.

By default, the Pyeapi client will look for an INI style hidden (with a period in front) file called eapi.conf in your home directory. You can override this behavior by specifying the eapi.conf file path, but it is generally a good idea to separate your connection credential and lock it down from the script itself. You can check out the Arista Pyeapi documentation (http://pyeapi.readthedocs.io/en/master/configfile.html#configfile) for the fields contained in the file. Here is the file I am using in the lab:

cat ~/.eapi.conf
[connection:Arista1]
host: 192.168.199.158
username: admin
password: arista
transport: https

The first line, [connection:Arista1], contains the name that we will use in our Pyeapi connection; the rest of the fields should be pretty self-explanatory. You can lock down the file to be read-only for the user using this file:

$ chmod 400 ~/.eapi.conf
$ ls -l ~/.eapi.conf
-r-------- 1 echou echou 94 Jan 27 18:15 /home/echou/.eapi.conf

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.143.103