Introduction

The Python Client for eAPI (pyeapi) is a native Python library wrapper around Arista EOS eAPI. It provides a set of Python language bindings for configuring Arista EOS nodes.

The Python library can be used to communicate with EOS either locally (on-box) or remotely (off-box). It uses a standard INI-style configuration file to specify one or more nodes and connection profiles.

The pyeapi library also provides an API layer for building native Python objects to interact with the destination nodes. The API layer is a convenient implementation for working with the EOS configuration and is extensible for developing custom solutions.

This library is freely provided to the open source community for building robust applications using Arista EOS. Support is provided as best effort through Github issues.

Installation

The installation of pyeapi is straightforward and simple. As mentioned in the Introduction, pyeapi can be run on-box or off-box. The instructions below will provide some tips to help you for either platform.

Pip with Network Access

If your platform has internet access you can use the Python Package manager to install pyeapi

admin:~ admin$ sudo pip install pyeapi

Note

You will likely notice Pip install netaddr, a dependency of pyeapi.

Pip - Upgrade Pyeapi

admin:~ admin$ sudo pip install --upgrade pyeapi

Pip without Network Access

If you want to install pyeapi on a switch with no internet access:

Step 1: Download Pypi Package

  • Download the latest version of pyeapi on your local machine.
  • You will also need a dependency package netaddr.

Step 2: SCP both files to the Arista switch and install

admin:~ admin$ scp path/to/pyeapi-<VERSION>.tar.gz ansible@veos01:/mnt/flash/
admin:~ admin$ scp path/to/netaddr-<VERSION>.tar.gz ansible@veos01:/mnt/flash/

Then SSH into your node and install it. Be sure to replace <VERSION> with the actual filename:

[admin@veos ~]$ sudo pip install /mnt/flash/netaddr-<VERSION>.tar.gz
[admin@veos ~]$ sudo pip install /mnt/flash/pyeapi-<VERSION>.tar.gz

These packages must be re-installed on reboot. Therefore, add the install commands to /mnt/flash/rc.eos to trigger the install on reboot:

[admin@veos ~]$ vi /mnt/flash/rc.eos

Add the lines (the #! may already exist in your rc.eos)

#!/bin/bash
sudo pip install /mnt/flash/netaddr-<VERSION>.tar.gz
sudo pip install /mnt/flash/pyeapi-<VERSION>.tar.gz

Development - Run pyeapi from Source

Tip

We recommend running pyeapi in a virtual environment. For more information, read this.

These instructions will help you install and run pyeapi from source. This is useful if you plan on contributing or if you’d always like to see the latest code in the develop branch.

Important

These steps require Pip and Git

Step 1: Clone the pyeapi Github repo

# Go to a directory where you'd like to keep the source
admin:~ admin$ cd ~/projects
admin:~ admin$ git clone https://github.com/arista-eosplus/pyeapi.git
admin:~ admin$ cd pyeapi

Step 2: Check out the desired version or branch

# Go to a directory where you'd like to keep the source
admin:~ admin$ cd ~/projects/pyeapi

# To see a list of available versions or branches
admin:~ admin$ git tag
admin:~ admin$ git branch

# Checkout the desired version of code
admin:~ admin$ git checkout v0.3.3

Step 3: Install pyeapi using Pip with -e switch

# Go to a directory where you'd like to keep the source
admin:~ admin$ cd ~/projects/pyeapi

# Install
admin:~ admin$ sudo pip install -e ~/projects/pyeapi

Step 4: Install pyeapi requirements

# Go to a directory where you'd like to keep the source
admin:~ admin$ pip install -r dev-requirements.txt

Tip

If you start using pyeapi and get import errors, make sure your PYTHONPATH is set to include the path to pyeapi.

Development - Upgrade Pyeapi

admin:~ admin$ cd ~/projects/pyeapi
admin:~ admin$ git pull

Note

If you followed the directions above and used pip install -e, pip will automatically use the updated code.

Quickstart

In order to use pyeapi, the EOS command API must be enabled using configuration mode. This library supports eAPI calls over both HTTP/S and UNIX Domain Sockets. Once the command API is enabled on the destination node, create a configuration file with the node properties. There are some nuances about the configuration file that are important to understand; take a minute and read about the Pyeapi Configuration File.

Enable EOS Command API

Refer to your official Arista EOS Configuration Guide to learn how to enable EOS Command API. Depending upon your software version, the options available include:

  • HTTP
  • HTTPS
  • HTTPS Certificates
  • HTTP Local
  • Unix Socket

Install Pyeapi

Follow the instructions on the Installation guide to prepare your node for pyeapi.

Create an eapi.conf file

Follow the instructions on the Pyeapi Configuration File guide to create a pyeapi configuration file. You can skip this step if you are running the pyeapi script on-box and Unix Sockets are enabled for EOS Command API.

Connect to a Node

The Python client for eAPI was designed to be easy to use and implement for writing tools and applications that interface with the Arista EOS management plane.

Once EOS is configured properly and the config file created, getting started with a connection to EOS is simple. Below demonstrates a basic connection using pyeapi. For more examples, please see the examples folder on Github.

This first example shows how to instantiate the Node object. The Node object provides some helpful methods and attributes to work with the switch.

# start by importing the library
import pyeapi

# create a node object by specifying the node to work with
node = pyeapi.connect_to('veos01')

# send one or more commands to the node
node.enable('show hostname')
[{'command': 'show hostname',
  'encoding': 'json',
  'result': {u'hostname': u'veos01',
             u'fqdn': u'veos01.arista.com'}}]

# Request a specific revision of a command that has been updated
node.enable({'cmd': 'show cvx', 'revision': 2})
[{'command': {'cmd': 'show cvx', 'revision': 2},
  'encoding': 'json',
  'result': {u'clusterMode': False,
             u'controllerUUID': u'',
             u'enabled': False,
             u'heartbeatInterval': 20.0,
             u'heartbeatTimeout': 60.0}}]

# use the config method to send configuration commands
node.config('hostname veos01')
[{}]

# multiple commands can be sent by using a list
# (works for both enable or config)
node.config(['interface Ethernet1', 'description foo'])
[{}, {}]

# return the running or startup configuration from the
# node (output omitted for brevity)
node.running_config

node.startup_config

The pyeapi library provides both a client for send and receiving commands over eAPI as well as an API for working directly with EOS resources. The API is designed to be easy and straightforward to use yet also extensible. Below is an example of working with the vlans API

# create a connection to the node
import pyeapi
node = pyeapi.connect_to('veos01')

# get the instance of the API (in this case vlans)
vlans = node.api('vlans')

# return all vlans from the node
vlans.getall()
{'1': {'state': 'active', 'name': 'default', 'vlan_id': 1, 'trunk_groups': []},
'10': {'state': 'active', 'name': 'VLAN0010', 'vlan_id': 10, 'trunk_groups':
[]}}

# return a specific vlan from the node
vlans.get(1)
{'state': 'active', 'name': 'default', 'vlan_id': 1, 'trunk_groups': []}

# add a new vlan to the node
vlans.create(100)
True

# set the new vlan name
vlans.set_name(100, 'foo')
True

Pyeapi Configuration File

The pyeapi configuration file is a convenient place to store node connection information. By keeping connection information central, your pyeapi scripts can effortlessly reference nodes without any manual import of credentials or location information. Therefore, the pyeapi configuration file becomes a reflection of your switch inventory and the way in which the EOS Command API is enabled on the node. The following explains how to craft your pyeapi configuration file to address specific implementation styles.

eapi.conf Parameters

The following configuration options are available for defining node entries:

host:

The IP address or FQDN of the remote device. If the host parameter is omitted then the connection name is used

username:

The eAPI username to use for authentication (only required for http or https connections)

password:

The eAPI password to use for authentication (only required for http or https connections)

enablepwd:

The enable mode password if required by the destination node

transport:

Configures the type of transport connection to use. Valid values are:

  • socket (default, available in EOS 4.14.5 or later)
  • http_local (available in EOS 4.14.5 or later)
  • http
  • https
  • https_certs
port:

Configures the port to use for the eAPI connection. A default port is used if this parameter is absent, based on the transport setting using the following values:

  • transport: http, default port: 80
  • transport: https, default port: 443
  • transport: https_certs, default port: 443
  • transport: http_local, default port: 8080
  • transport: socket, default port: n/a

When is an eapi.conf file needed?

It’s important to understand the nuances of the pyeapi configuration file so you can simplify your implementation. Here’s a quick summary of when the eapi.conf file is needed:

Transport eapi.conf Required Script run from Authentication Required
http Yes On/Off-switch Yes
https Yes On/Off-switch Yes
https_certs Yes On/Off-switch Yes (Auth done via certs, not un/pw)
http_local Yes On-switch only No
socket No On-switch only No

Where should the file be placed?

Search Order Search Location
1 Environment Variable EAPI_CONF=/path/to/eapi.conf
2 $HOME/.eapi.conf
3 /mnt/flash/eapi.conf

Note

There is a slight difference in #2 .eapi.conf versus #3 eapi.conf

eapi.conf for On-box Implementations

This method would be used to run a pyeapi script on-box. In this mode, eAPI can be configured to require or not require authentication depending upon how you enabled EOS Command API.

Notice from the table above, that if EOS Command API Unix Sockets are enabled, or HTTP Local, you get the benefit of not needing to pass in credentials since the connection can only be made from localhost and it assumes the user has already authenticated to get on the switch.

Using Unix Sockets

This is the preferred method. The default transport for pyeapi is socket and the default host is localhost. Therefore, if running a pyeapi script on-box and have Unix Sockets enabled, you do not need an eapi.conf, nor do you need to pass any credentials (quite handy!).

Note

Unix Sockets are supported on EOS 4.14.5+

Using HTTP Local

As the table above indicates, a pyeapi configuration file is required in /mnt/flash/eapi.conf. It would contain something like:

[connection:localhost]
transport: http_local

Pay attention: once eapi.conf exists, the respective protocol method must be configured on the box. E.g., for the above eapi.conf sample, the following configuration must also exist:

switch(config)#management http-server
switch(config-mgmt-http-server)#protocol http localhost

Using HTTP or HTTPS

As the table above indicates, a pyeapi configuration file is required in /mnt/flash/eapi.conf. It would contain something like:

[connection:localhost]
transport: http[s]
username: admin
password: admin

eapi.conf for Off-box Implementations

This method would be used to run a pyeapi script from another server. In this mode, eAPI will require authentication. The only real option is whether you connect over HTTP or HTTPS.

Note

The socket and http_local transport options are not applicable.

Notice from the table above, that if EOS Command API Unix Sockets are enabled, or HTTP Local, you get the benefit of not needing to pass in credentials since the connection can only be made from localhost and it assumes the user has already authenticated to get on the switch.

Using HTTP or HTTPS

As the table above indicates, a pyeapi configuration file is required in $HOME/.eapi.conf. It would contain something like:

[connection:veos01]
transport: http
username: paul
password: nottelling

[connection:veos03]
transport: https
username: bob
password: mysecret

[connection:veos04]
host: 192.168.2.10
transport: https
username: admin
password: admin

Note

avoid using localhost name in the connection description (i.e.: [connection:localhost]). The name localhost is reserved solely for on-box connection method and it won’t work when connecting off-box

Using HTTPS with Certificates

The https_certs transport options allows users to do authentication for pyeapi with certificates instead of username/password. This requires functional certificate chains are setup, copied to the proper location and trusted by EOS beforehand. The ca_file parameter is optional. If provided the switches certificate will also be validated against the provided CA cert. If no CA cert is provided then no server side validation will be done.

[connection:veos01]
transport: https_certs
cert_file: /path/to/certificate/file
key_file: /path/to/private/key/file
ca_file: /path/to/CA/certificate/file

[connection:veos02]
transport: https_certs
cert_file: /path/to/certificate/file
key_file: /path/to/private/key/file

The DEFAULT Section

The [DEFAULT] section can be used to gather globally applicable settings. Say that all of your nodes use the same transport or username, you can do something like:

[connection:veos01]

[connection:veos03]
transport: https
username: bob
password: mysecret

[connection:veos04]
host: 192.168.2.10

[DEFAULT]
transport: https
username: admin
password: admin

Modules

Requirements

  • Arista EOS 4.22 or later
  • Arista eAPI enabled for at least one transport (see Official EOS Config Guide at arista.com for details)
  • Python 3.7+
  • Pyeapi requires the netaddr Python module

Note

netaddr gets installed automatically if you use pip to install pyeapi

Configuration Examples Using pyeapi

Configuring Subinterfaces Using Python Client for eAPI

Subinterfaces can be configured on Ethernet and Port-Channel interfaces. To do this in pyeapi simply call create or delete with your subinterface name.

Subinterfaces require that the primary interface be in routed mode.

import pyeapi
node = pyeapi.connect_to('veos01')
node.api('ipinterfaces').create('Ethernet1')

At this point the below should be in your running configuration.

!
interface Ethernet1
   no switchport
!

Next step is to create the subinterface

node.api('interfaces').create('Ethernet1.1')
!
interface Ethernet1
   no switchport
!
interface Ethernet1.1
!

Subinterfaces also require a vlan to be applied to them.

node.api('interfaces').set_encapsulation('Ethernet1.1', 4)
!
interface Ethernet1
   no switchport
!
interface Ethernet1.1
   encapsulation dot1q vlan 4
!

Using delete in the same format as create will remove the subinterface.

For more detailed information about configuring subinterfaces in EOS, reference the user manual for the version of EOS running on your switch.

Contribute

The Arista EOS+ team is happy to accept community contributions to the Pyeapi project. Please note that all contributions that modify the library behavior require corresponding test cases otherwise the pull request will be rejected.

Testing

The pyeapi library provides both unit tests and system tests. The unit tests can be run without an EOS node. To run the system tests, you will need to update the dut.conf file found in test/fixtures.

Unit Test

To run the unit tests, simply run make unittest from the root of the pyeapi source folder

System Test

To run the system tests, simply run make systest from the root of the pyeapi source folder.

Tip

To run all tests, use make tests from the root of the pyeapi source folder

Coverage

Contributions should maintain 100% code coverage. You can check this locally before submitting your Pull Request.

  1. Run make unittest
  2. Run make coverage_report to confirm code coverage.

Release Notes

Release 1.0.2

2023-06-30

New Modules

Enhancements

Fixed

  • Fixed a regression introduced by PR#220 (220)
    Performance enchancement achieved with cacheing in PR#220 has a side effect: if configuration was read before the config modifications made, then the modifications won’t be reflected in the consecutive configuration reads (due to the cached read)
  • Fixed all failing system tests, plus made some improvements in unit tests.

Known Caveats

Release 1.0.0

2023-06-06

  • This is a Python3 (3.7 onwards) release only (Python2 is no longer supported)
  • Arista EOS 4.22 or later required (for on-box use cases only)

New Modules

Enhancements

Fixed

  • Let config method to raise ConnectionError exception (198)
    The fix ensures that the behavior is consistent with other methods.
  • Fixed parsing of VLAN groupings by vlans.getall() (200)
    The fix allows handling a case when multiple VLANs in the configs may be grouped under a common (group) name.
  • Enhanced vlans.get() to return an actual list of VLANs (202)
    The method used to return the argument itself (e.g., an RE: 200-.*), now the actual list of matched VLANs is returned
  • Fixed a corner crash in portsVlans.getall() (213)
    The crash may occur when the switchport is configured with a VLAN profile
  • Improved switchports.getall() behavior (216)
    The method will not consider subinterfaces anymore
  • Improved JSON parsing speed (166)
    User may improve the speed by using ujson or rapidjson modules. The standard json is used as a fallback.
  • Allow user to specify an SSL context (234)
    Provided the argument option context to specify an SSL context in connection() method.
  • Fixed user password vulnerability in tracebacks (238)
    A user password is exposed in a traceback, which could occur due to invalid credentials.
  • Added support for login password exclusively for ssh-key authentication (227)
    Catching up with EOS CLI which already supports such login password.
  • Fixed user password vulnerability in debugs (242)
    A user password was exposed in user enabled debugs. With this commit the user password is masked out now.
  • Added option not to include config defaults (221)
    Reading running-config or startup-config with default values is not always a desirable behavior. This commit adds an option to control such behavior.
  • Fixed a corner crash in ipinterfaces module (210)
    Fixed a crash when MTU value is not present in the interface configuration (this is rather a corner case condition).
  • Fixed a bug where vxlan floodlist might return a bogus data (193)
    Fixed the issue with interfaces module, where get() method returned vxlan data structure with flood_list parsed incorrectly.
  • Improved performance of config parsing (220)
    Drastically improved perfromance of config parsing by cacheing section splitting results. This fix also tightens the prior relaxed section match behavior by allowing matching only section line (as vs entire section’s content)
  • Enhanced PR (220) allowing to match sub-sections (245)
    After PR #220, matching subsections was impossible (only entire section could have been matched). This enhancement brings back such functionality.
  • Added support for a session based authentication (203)
    Added a couple new transport options (http_session and https_session) to connect() method to support a session based authentication.
  • Added support infrastructure to handle deprecated EOS CLI (247)
    The added CliVariants class helps managing transitions from deprecated EOS CLI (by allowing specifying both, new and deprecated CLI variants).
  • Added support for parsing secondary ip addresses (251)
    The added fix extends the return result for get() method of ipinterfaces module with the parsed secondary ip addresses (if present).
  • A minor fix to include internal exception handling (252)
    With this fix the pyeapi.eapilib.CommandError exception will elaborate on the causes of internal errors.
  • Enhance parsing of BGP router section with asdot notation (256)
    Allow matching and parsing router bgp sections if spelled with asdot notation.
  • removed and updated deprecations (204, 212, 235, 260, 262, 263)
  • documentation fixes and updates (209, 225, 239, 257, 259)

Known Caveats

Release 0.8.4

2020-11-13

New Modules

Enhancements

  • Add streaming capability for eapi interface
  • Add Power ppc64le support with CI

Fixed

Known Caveats

Release 0.8.3

2020-01-26

New Modules

Enhancements

  • Support eapi command revision syntax (181)
  • Add ability to use pyeapi with certificates
  • Added check for ‘match’ statement to be valid before parsing regex ACL

Fixed

Known Caveats

Release 0.8.2

2018-02-09

New Modules

Enhancements

  • Support eapi command revision syntax (158) [jerearista]

    Support requests for specific revisions of EOS command output

    >>> node.enable({'cmd': 'show cvx', 'revision': 2})
    [{'command': {'cmd': 'show cvx', 'revision': 2},
      'encoding': 'json',
      'result': {u'clusterMode': False,
                 u'controllerUUID': u'',
                 u'enabled': False,
                 u'heartbeatInterval': 20.0,
                 u'heartbeatTimeout': 60.0}}]
    
  • Add clearer error message for bad user credentials. (152) [mharista]
  • Reformat EapiConnection send methods exception handling. (148) [mharista]

Fixed

  • Fix route map getall function to find route maps with a hyphen in the name. (154) [mharista]

Known Caveats

v0.8.1

2017-07-20

New Modules

Enhancements

Fixed

  • hard coded /command-api was probably a safe default (141)
    This issue/PR (142) reverts a change that introduced a bug breaking pyeapi’s unix-socket connection. Regardless of using TCP/IP or unix-socket for communicating with the EAPI process the data being sent to the process is formatted in HTTP requests. The HTTP requests should always POST to the /command-api endpoint. The change being reverted by this prevents the unix-socket path from ever erroneously being used as the HTTP endpoint.
  • Execute does not work well with long running commands (138)
    Added socket specific error messages in PR (144) to help distinguish errors caused by command timeouts.
  • eAPI does not handle commands sent as unicode strings (137)
    Bug fixed in PR (139) unicode commands converted to strings when detected.

v0.8.0

2017-03-14

New Modules

  • Base API for VRF support. (133) [mharista]
    Added new API module for creating VRFs. In addition to creating, configuring and removing VRFs the updates allow for applying a VRF to an interface and creating a VRF specific OSPF instance.

Enhancements

  • Add base extended ACL support. (135) [mharista]
    Updated ACL api to include extended ACLs in addition to standard. To create an extended ACL provide the type as extended when creating the ACL (default is standard). Currently extended ACL statements can be added with action, protocol, and source/destination address. The API will determine the type of ACL by name after it has been created for future updates.
  • Add support for creating and deleting ethernet subinterfaces (132) [mharista]
    Allow for creation and deletion of ethernet subinterfaces as part of the EthernetInterface class. Subinterfaces are also supported on PortChannel interfaces. An example using the API to create an ethernet subinterface is provided in the docs.
  • Add node attributes from show version command (131) [mharista]
    Added information from show version as attributes to a node. Version, version number and model are added. Version number is simply the numeric portion of the version. For example 4.17.1 if the version is 4.17.1M. All three parameters are populated from the output of show version when any one of the parameters is accessed the first time.
  • Add support for eAPI expandAliases parameter (127) [mharista]
    Allowed users to provide the expandAliases parameter to eAPI calls. This allows users to use aliased commands via the API. For example if an alias is configured as ‘sv’ for ‘show version’ then an API call with sv and the expandAliases parameter will return the output of show version.
  • Add support for autoComplete parameter. Issue 119 (123) [mharista]
    Allows users to use short hand commands in eAPI calls. With this parameter included a user can send ‘sh ver’ via eAPI to get the output of show version.
  • expose portchannel attributes :lacp fallback, lacp fallback timeout (118) [lruslan]
    Helps for configuring LACP fallback in EOS.

Fixed

  • API path is hardcoded in EapiConnection.send() (129)
    Updated the previously hardcoded path to /command-api in the EAPI connection to use the transport objects path.
  • Cannot run ‘no ip virtual-router mac-address’ in eos 4.17.x (122)
    Fixed command format for negating an ip virtual-router mac-address. Default and disable forms of the command changed and require the mac-address value in EOS 4.17. Update fixes this for newer versions and is backwards compatible.
  • Non-standard HTTP/s port would cause connection to fail (120)
    Bug fixed in PR (121) where a port passed in via eapi.conf as a unicode value caused the http connection to fail.

v0.7.0

2016-09-08

New Modules

  • Add OSPF API (95) [brigoldberg]
    Big thanks for the community support!

Enhancements

  • Enhance Node enable() method (100) [dathelen]
    This enhancement adds a send_enable flag to the enable and run_commands Node methods. By default the enable command will be sent, however you can now run commands without prepending the enable.
  • Finish OSPF API (99) [dathelen]
    Create system tests and add unit tests to increase code coverage.
  • Add Cross-Platform Support for pyeapi (94) [grybak-arista]
    Use logging instead of syslog for better cross-platform compatibility. This enhancement provides support for Windows users.

Fixed

  • Allow dot and hyphen in mlag domain-id (91)
    Include handling any character in domain-id string, including dot, hyphen, and space.

v0.6.1

2016-03-04

(This is a hotfix release)

New Modules

  • None

Enhancements

  • None

Fixed

  • SR56181 - pyeapi 0.5.0 and 0.6.0 aren’t able to execute commands with enable password (88)
    A regression was introduced in 0.5.0 which broke passing the enable password to the Node() object.

v0.6.0

2016-02-22

New Modules

  • None

Enhancements

  • Added support for multiline commands without having to pass them as a dictionary (78) [dbarrosop]
    (See example below)
>>> import pyeapi
>>> connection = pyeapi.client.connect(
...     transport='https',
...     host='192.168.56.201',
...     username='vagrant',
...     password='vagrant',
...     port=443,
...     timeout=60
... )
>>> device = pyeapi.client.Node(connection)
>>> device.run_commands('show hostname')
[{u'hostname': u'localhost', u'fqdn': u'localhost'}]
>>> device.run_commands('show banner login')
[{u'loginBanner': u''}]
>>> my_commands = [
...     'configure session whatever',
...     'hostname new-hostname',
...     'banner login MULTILINE:This is a new banner\nwith different lines!!!',
...     'end'
... ]
>>>
>>> device.run_commands(my_commands)
[{}, {}, {}, {}]
>>> print device.run_commands(['show session-config named whatever diffs'], encoding='text')[0]['output']
--- system:/running-config
+++ session:/whatever-session-config
@@ -3,6 +3,8 @@
! boot system flash:/vEOS-lab.swi
!
transceiver qsfp default-mode 4x10G
+!
+hostname new-hostname
!
spanning-tree mode mstp
!
@@ -22,6 +24,11 @@
!
no ip routing
!
+banner login
+This is a new banner
+with different lines!!!
+EOF
+!
management api http-commands
  no shutdown
!
>>> device.run_commands(['configure session whatever', 'commit'])
[{}, {}]
>>> device.run_commands('show hostname')
[{u'hostname': u'new-hostname', u'fqdn': u'new-hostname'}]
>>> device.run_commands('show banner login')
[{u'loginBanner': u'This is a new banner\nwith different lines!!!\n'}]
>>>

v0.5.0

2016-02-16

New APIs

Enhancements

  • Add banner support to System API (75) [dathelen]
    Add API support for EOS banners and motd.
  • Issue #18 performance fixes (74) [cheynearista]
    Rework underlying HTTP transport to improve receive performance.
  • Redmine issue 648 (73) [grybak-arista]
    Fix some instances where an empty string as negation would not properly negate the option/command.
  • setup.py print statement for python 3 (71) [mzbenami]
    Reformat print statement to work properly with Python3+
  • Implement add ACL with seq nos (70) [dathelen]
    Add a sequence number when adding a new ACL entry.
  • Fix for redmine issues 234 and 268 (68) [grybak-arista]
    Reworked some system tests for robustness get_block accepts a config string as well as the default ‘running_config’
  • fix #7 and fix #37 (67) [grybak-arista]
    Certain command errors will return more detailed information. The connect() method can optionally return a node object.
  • Add disable key to existing modules for negation of properties (65) [grybak-arista]
    Modules now take disable=<True/False> to negate the command, rather than overloading value.
  • Compatibility fix for current mock versions (64) [wtucker]
  • Add key error checking to set_tracks (63) [grybak-arista]

Fixed

  • Failure when eapi.conf is not formatted correctly (38)
    Adds more robust error handling when parsing eapi.conf files. Also, if an error is found it will syslog the error and continue parsing any other eapi.conf files.

Known Caveats

v0.4.0

2015-11-05

New APIs

  • Add VRRP (57) [grybak]
    Add support for VRRP configuration.
  • Add Staticroute (45) [grybak]
    The staticroute API enables you to set static IPv4 routes on your EOS device.
  • Add VARP (43) [phil-arista]
    The Varp API includes the subclass VarpInterfaces. These two combine to provide methods to set virtual IP addresses on interfaces as well as set the global virtual-router mac-address.
  • Add Routemap (40) [phil-arista]

Enhancements

  • Making configure RADIUS compatible (53) [GaryCarneiro]
    Modifies the syntax of the config method to use configure terminal instead of just configure.
  • Close #46 (47) [phil-arista]
    This enhancement allows you to set the LACP Mode while executing the set_members method. The call would look like node.api('interfaces').set_members(1, [Ethernet1,Ethernet2], mode='active')
  • Added support to specify timeout (41) [dbarrosop]
    This enhancement provides a way to specify a connection timeout. The default is set to 60 seconds.
  • Add BGP maximum-paths support (36) [phil-arista]
    This enhancement adds more attributes to eos_bgp_config. This provides the ability to configure maximum-paths N ecmp M in your router bgp R configuration.
  • Add sshkey support to users API (34) [phil-arista]
    This enhancement augments the users API to now support SSH Keys.

Fixed

  • client.py ‘def enable’ returned dictionary key inconsistency (35)
    The key that’s supposed to be returned is result but instead the method formerly returned the key response. For now, both response and result will be returned with the same data, but response will be removed in a future release.
  • [API Users] Can’t run set_role with no value (33)
    The node.api(‘users’).set_role(‘test’) method didn’t remove the role or default the role as you would expect. This bug fix resolves that.
  • [API Users] Can’t run set_privilege with no value (32)
    The set_privilege(‘user’) method did not properly negate the privilege level when no argument was passed into the method.
  • [ API interfaces ] get_members regex wrongly includes PeerEthernet when lag is up (28)
    The get_members() method wrongly included a duplicate member when the show port-channel N all-ports showed the PeerEthernetX. The regular expression has been updated to ignore these entries.
  • [API] users - can’t create password with non-alpha/int characters (23)
    The characters (){}[] cannot be part of a username. Documentation has been updated to reflect this.
  • Users with sha512 passwords don’t get processed correctly using api(‘users’).getall() (22)
    Fixed regex to extract the encrypted passwords accurately.

Known Caveats

  • failure when eapi.conf is not formatted correctly (38)

v0.3.3

2015-07-31

  • added initial support for bgp api module
  • add trunk group functionality to switchports
  • add ip routing to system api

v0.3.2

2015-07-16

  • fixes a problem with parsing the hostname value in the system module

v0.3.1

2015-06-14

  • make pyeapi compatible under Python 3.4 with all unit tests passing ok
  • added socket_error property to connection to capture socket errors
  • adds function to create per vlan vtep flood lists

v0.3.0

2015-05-04

  • fixes an issue with configuring stp portfast edge correctly
  • fixes #13
  • fixes #11
  • added initial support for system api module
  • added initial support for acl api module (standard)
  • added initial api support for mlag configuration
  • added tag feature to eapi.conf

v0.2.4

2015-04-30

  • adds required docs/description.rst for setup.py

v0.2.3

2015-04-29

  • fixes issue with importing syslog module on Windows

v0.2.2

2015-04-15

  • fixes an issue with eAPI error messages that do not return a data key

v0.2.1

2015-03-28

  • restores default certificate validation behavior for py2.7.9

v0.2.0

2015-03-19

  • adds udp_port, vlans and flood_list attributes to vxlan interfaces
  • renames spanningtree api module to stp for consistency
  • depreciated spanningtree api module in favor of stp
  • interfaces module now properly responds to hasattr calls
  • fixes an issue with collecting the vxlan global flood list from the config
  • fixes an issue with properly parsing portchannel configurations
  • adds portfast_type attribute to stp interfaces resource

v0.1.1

2015-02-17

  • adds introspection properties to CommandError for more details (#4)
  • changed the default transport from HTTP to HTTPS to align with EOS
  • updates the message returned if the connection profile name is not found
  • fixes connection name not copied to host parameter if host not configured
  • fixes an issue where an ipinterface wasnt properly recognized
  • fixes an issue where a switchport interface was propertly recognized

v0.1.0

2015-01-23

  • initial public release of pyeapi
  • initial support for vlans
  • initial support for interfaces
  • initial support for spanningtree
  • initial support for switchports
  • initial support for ipinterfaces

Support

Contact

Pyeapi is developed by Arista EOS+ CS and supported by the Arista EOS+ community. Support for the code is provided on a best effort basis by the Arista EOS+ CS team and the community. You can contact the team that develops these modules by sending an email to eosplus-dev@arista.com.

For customers that are looking for a premium level of support, please contact your local account team or email eosplus@arista.com for help.

Submitting Issues

The Arista EOS+ CS development team uses Github Issues to track discovered bugs and enhancement requests. The issues tracker can be found at https://github.com/arista-eosplus/pyeapi/issues.

For defect issues, please provide as much relevant data as possible as to what is causing the issue, if and how it is reproducible, the version of EOS, python, and any OS details.

For enhancement requests, please provide a brief description of the enhancement request and the version of EOS to be supported.

The issue tracker is monitored by Arista EOS+ CS and issues submitted are categorized and scheduled for inclusion in upcoming Pyeapi versions.

License

Copyright (c) 2015, Arista Networks EOS+ All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the Arista nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Indices and tables