An Introduction to the Golang eAPI

Introduction Since the release of Arista EOS Command API (eAPI) many have grown to appreciate its stability and easy-to-use syntax which allow applications or scripts complete programmatic control over EOS. Development of applications that interface with your Arista device for the purpose of configuration or monitoring is simple and fairly straight forward. With a little knowledge of Python, Perl, Ruby, or your favorite language of choice, and familiarity with the underlying transport mechanism (JSON-RPC), it’s easy to write some custom functionality to help with deployments, provisioning, configurations and many other things.  Arista has continued its ongoing effort to make life...
Continue reading →

Arista’s EOS Innovation Enabling Ecosystem Partner Software Development

Network software automation and intelligence is a passion we share as network engineering software developers at Intelligent Visibility, Inc. Creating innovative software solutions in the rising world of software-defined networking (SDN) can prove challenging. The source data that we require for our software is mostly located within the network device’s operating system. In the past accessing this source data has been a serious time investment mainly due to inconsistent API implementation types across different operating systems for many different hardware platforms.

Interface MTU with JSON and Python

Hi, I am trying to do something which I thought would be fairly simple using the EOS API, alas it is causing me some issues. I want to run the command “show interfaces” via the JSON API and then extract and print various bits of information. I have started off simple by (trying) to extract the MTU. This is my Python code: import json import jsonrpclib from jsonrpclib import Server switches = ["10.2.7.170"] username = "admin" password = "admin" # Going through all the switch IP addresses listed above for switch in switches: urlString = "https://{0}:{1}@{2}/command-api".format(username, password, switch) switchReq =...
Continue reading →

Working with the Python eAPI Client

This article builds on the Introduction to the Python Client for eAPI by taking a look at the pyeapi client a little deeper.  The client module provides a number of functions for making it easier to build connectivity to Arista EOS nodes running eAPI. To get started, lets begin by simply importing the pyeapi client in Python and review the how to build a node object. >>> import pyeapi >>> node = pyeapi.connect_to('veos01') As discussed in the introduction article, the above will search for and load the eapi.conf file.  Once the configuration file has been found and loaded by pyeapi,...
Continue reading →

Introducing the Python Client for eAPI (pyeapi)

The Arista EOS command API (eAPI) has been available in versions of EOS since the release of version 4.12.  It has proven to be an invaluable tool for building management plane applications, making it easy to develop solutions that interface with the device configuration and state information.  Building on the capabilities of eAPI, this article introduces the initial release of the Python Client for eAPI (pyeapi). The Python Client for eAPI (pyeapi) is a language specific client to make working eAPI even easier.  It is designed to assist network engineers, operators and devops teams to build eAPI applications faster without...
Continue reading →

Arista eAPI 101

In this article, you will get some quick ideas to use Arista eAPI to configure the switch via JSON-RPC remotely. Here is one Youtube video on eAPI if you prefer to watch something live: EOS Bits & Bytes – Episode 3 “Command API” The Arista Command eAPI is a simple and complete API that allows you to configure and monitor your Arista switches. Once the API is enabled, the switch accepts HTTP(S)  requests containing a list of industry standard CLI commands, and responds with machine-readable output and errors serialized in JSON (served over HTTP or HTTPS). eAPI was first introduced in...
Continue reading →

Programmatically update your routing table

Overview This article describes a script which is designed to allow the insertion/removal of a route in/from the routing table. If you want a way to remotely add/delete routes to/from your routing table, then this is the tool for you – using it will make insertion/removal of static routes as easy as running a script on any remote device that supports Python. How to get the code: Download the code Use your Github account and fork it (remember to contribute back) Installation The script (updateRoute) can be run/installed on any device that runs Python 2.7 or later. In order to run updateRoute, first...
Continue reading →

Dynamically update your interface name via port auto-description

Overview: Port auto-description will dynamically update the port description based on the LLDP information received from the neighbour. As always we are looking for your feedback please let us know if you have ideas on how to improve this script or other ideas… The tool: The script, called ‘portAuto’, will dynamically change the port description based on the neighbour’s LLDP information. This could be used as a stand alone script or part of a larger toolset. How to get the code: Get the code directly from Github https://github.com/arista-eosext/PortAutoDescription4 forks.7 stars.2 open issues.Recent commits: Update README.md, GitHub Add unix socket support, Philip DiLeo...
Continue reading →

Understanding EOS CLI implementation

This document gives an overview of the some of the APIs used for developing CLI Plugins. Although it tries to be as complete as possible, it only focuses on the most common APIs used by the CLI Plugins and it is not an exhaustive description of all the interfaces. The document is relevant for EOS version 4.12.0, although parts of the document might also apply to older releases. “Hello world!” example TestCli.py # Copyright(c)2013 AristaNetworks,Inc. All rights reserved. # Arista Networks, Inc. Confidential and Proprietary. import BasicCli import CliParser from CliModel import Model # Model ­ only required for eAPI...
Continue reading →