• Tag : API


Using the CloudVision API with Service Accounts

Description With the release of CloudVision Portal 2020.3, you have the ability to create Service Accounts. I won’t show you how to create a Service Account, but you can go to this TOI to read about that. This article will show you how to use Service Account Tokens in Python and cURL for API calls. Platform Compatibility This applies to both CVaaS and on-premise installations. How To Using a Service Account Token allows you to bypass the standard authentication process when making API calls. It also allows you to create a local “account” on CloudVision that doesn’t depend on outside authentication...
Continue reading →

CloudVision Wi-Fi and APIs

Introduction The article describes a few examples of how CloudVision Wi-Fi uses APIs to interface with Wireless Manager. Prerequisites Administrator or higher access to the Wireless Manager and API Keys Solution CloudVision Wi-Fi (CVW) does not store any Wi-Fi data or configuration. Instead, the Wireless Manager (WM) server collects all the data and stores it in its database. CVW polls the WM database periodically and represents it on its own UI using an internal web server. So, how does CVW fetch this data from the WM database? API  Samples Below are few  examples of the APIs that CVW uses to...
Continue reading →


Hello, Im using a REST API Client called Postman to send APIs to CVP. I’m receiving a “401” Response due to failed authentication. I was able to make the API call using the FQDN/web/api/ but I noticed it works only when a user is logged in to the CVP console. If no user is logged in then the API call fails with the failed authentication error. Also, I noticed when I used Postman or any other REST client the CVP console user was logged out automatically. Im doing something simple (a new label). I added the content-type and the authentication...
Continue reading →

service access-groups for management api http-commands

Hi all, I’m curious about the possibility to set a service acl under management api http-commands management api http-commands vrf default no shutdown ip access-group api-access ! vrf vrf-mgmt no shutdown ip access-group api-acc #sh ip access-lists api-access IP Access List api-access statistics per-entry 10 remark “Salt-Proxy” 20 permit ip any 30 deny ip any any #sh ip access-lists api-acc Standard IP Access List api-acc statistics per-entry 10 permit 15 permit 20 deny any both acls does not have any effect to restrict access to the api e.g. from src ip $ nc -zv 443...
Continue reading →

EAPI script to push extensions across list of EOS devices using Python

Introduction This article demonstrates Arista’s EOS automation capabilities leveraging eAPI. This document walks you through a script to Secure Copy (SCP) an extension on Arista switches along with installing the extension on the list of switches defined in the script. Pre-Requisites This script is supported on Linux/Unix/Mac Operation Systems. The Arista eAPI must be enabled on the switches and can be configured as follows: Arista> enable Arista# configure terminal Arista(config)# management api http-commands Arista(config-mgmt-api-http-cmds)# [no] shutdown Arista(config-mgmt-api-http-cmds)# [no] protocol https [port ] Arista(config-mgmt-api-http-cmds)# [no] protocol http [port ] Jsonrpclib python module, could be installed as follows: [admin@Arista ~]$ pip install jsonrpclib Deployment methods There...
Continue reading →

CVP APIs: A Non-Programmer’s Guide

1. What are CVP APIs? Most CloudVision Portal (CVP) users are familiar with the web user interface (UI) that facilitates network provisioning, inventory management, tasks management, change control and so on.  CVP application programming interfaces (APIs) offer an alternative means of realizing the same functionality.  The key difference is that, with the CVP APIs, the functionality is realized over a programmatic interface (i.e typically by a piece of software communicating with another piece of software) rather than by a user navigating over a web page and clicking and/or typing.  Figure 1 shows a simplified example of these two methods of...
Continue reading →

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 = [""] 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/PortAutoDescription 11 forks. 15 stars. 3 open issues. Recent commits: Update README.md, GitHub Add unix...
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 →


Get every new post on this blog delivered to your Inbox.

Join other followers: