Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Network Change & Configuration Management


External REST calls via Perl Job Scripting?

Posts: 1
3324     0

Is it possible to make external REST calls via perl jobs to return custom data?  I would like to query our infrastructure management system for a subset of devices and push that data into Network Automation on a scheduled basis.  I would also like to interact with Arista eAPI.  Will this work?  If not, is it on the roadmap?  Also, any thoughts on adding support for python?



Yes. The sandbox has external

Posts: 353
3325     0

Yes. The sandbox has external access via NAT. You can access REST interfaces. You can also install additional Perl modules to enable access to SQL databases, etc.

The Arista eAPI is an HTTP-based API, so you can use it directly - except that you would need to have the credentials passed into the script which may not be feasible. There is a Perl example here: https://eos.arista.com/arista-eapi-101/


You'll have to discuss any roadmap plans with your account team, who can put you in touch with our product management. We can't discuss it here. 

If you don't mind using the RESTful API directly (rather than through the object model in the Perl SDK), you can pass the DIS session ID and CLI connection ID parameters, along with DeviceID and whatever else you need, to a Python script from the Perl script.




Re: Yes. The sandbox has external

Posts: 62
3325     0

Python support was added in 7.2.


Re: Yes. The sandbox has external

Posts: 422
3325     0

You can use python with the following example to make a call to your assest system and Arista Smiley Happy



# Script-Filter:
#     true

import urllib.request
import json, re

with urllib.request.urlopen( "https://jsonplaceholder.typicode.com/users" ) as r:
    f = r.read().decode('utf-8')

json_input = f

decoded = json.loads(json_input)

for j in decoded:
    print (j['username'], j['website'])
Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh
Showing results for 
Search instead for 
Do you mean 

Recommended for You