Arista EAPI RPC Support #131

Closed
opened 2025-12-29 15:34:43 +01:00 by adam · 6 comments
Owner

Originally created by @ryanmerolle on GitHub (Jul 1, 2016).

Add Arista to the RPC support.

For testing purposes, Arista allows for virtualized instances of their EOS platform. https://eos.arista.com/tag/veos/

Originally created by @ryanmerolle on GitHub (Jul 1, 2016). Add Arista to the RPC support. For testing purposes, Arista allows for virtualized instances of their EOS platform. https://eos.arista.com/tag/veos/
adam closed this issue 2025-12-29 15:34:43 +01:00
Author
Owner

@laetrid commented on GitHub (Jul 2, 2016):

I can help with Arista.
What kind of integration with netbox?

@laetrid commented on GitHub (Jul 2, 2016): I can help with Arista. What kind of integration with netbox?
Author
Owner

@dinoocch commented on GitHub (Jul 5, 2016):

Instead of writing new functionality for this, it may be more desirable to use a package like netmiko instead of paramiko, which will abstract out a lot of the logic that is built into the current RPC.

@dinoocch commented on GitHub (Jul 5, 2016): Instead of writing new functionality for this, it may be more desirable to use a package like [netmiko](https://github.com/ktbyers/netmiko) instead of [paramiko](https://github.com/paramiko/paramiko), which will abstract out a lot of the logic that is built into the current RPC.
Author
Owner

@jgill-arista commented on GitHub (Jul 6, 2016):

netmiko is really nice for setting up the session and getting output. Using EAPI has an advantage in that almost all the responses are already parsed into JSON for easy digestion.

I am not familiar with netbox(yet) and what RPC calls are made where, but I can provide some assistance/testing/exmaples/gruntwork if it helps. I have vEOS and hardware switches to verify.

Tip: you can see this jsonified output from the CLI by piping to | json

co301...07:10:04#sh spanning-tree int e47
Instance         Role       State      Cost      Prio.Nbr Type
---------------- ---------- ---------- --------- -------- --------------------
MST0             root       forwarding 2000      128.47   P2p

co301...07:10:08#sh spanning-tree int e47 | json
{
    "interface": "Ethernet47",
    "spanningTreeInstances": {
        "MST0": {
            "priority": 128,
            "linkType": "p2p",
            "state": "forwarding",
            "cost": 2000,
            "role": "root",
            "inconsistentFeatures": {
                "loopGuard": false,
                "rootGuard": false,
                "mstPvstBorder": false,
                "bridgeAssurance": false
            },
            "portNumber": 47,
            "isEdgePort": false,
            "boundaryType": "none"
        }
    }
}
@jgill-arista commented on GitHub (Jul 6, 2016): [netmiko](https://github.com/ktbyers/netmiko) is really nice for setting up the session and getting output. Using EAPI has an advantage in that _almost_ all the responses are already parsed into JSON for easy digestion. I am not familiar with netbox(_yet_) and what RPC calls are made where, but I can provide some assistance/testing/exmaples/gruntwork if it helps. I have vEOS and hardware switches to verify. Tip: you can see this jsonified output from the CLI by piping to `| json` ``` co301...07:10:04#sh spanning-tree int e47 Instance Role State Cost Prio.Nbr Type ---------------- ---------- ---------- --------- -------- -------------------- MST0 root forwarding 2000 128.47 P2p co301...07:10:08#sh spanning-tree int e47 | json { "interface": "Ethernet47", "spanningTreeInstances": { "MST0": { "priority": 128, "linkType": "p2p", "state": "forwarding", "cost": 2000, "role": "root", "inconsistentFeatures": { "loopGuard": false, "rootGuard": false, "mstPvstBorder": false, "bridgeAssurance": false }, "portNumber": 47, "isEdgePort": false, "boundaryType": "none" } } } ```
Author
Owner

@laetrid commented on GitHub (Jul 6, 2016):

Agree with jgill-arista, you can easily request data via JSON RPC from Arista, for example:

  from jsonrpclib import Server

   switch = Server( "https://username:passw0rd@myswitch/command-api" )
   response = switch.runCmds( 1, ["show version"] )

and get response in JSON.
As I understand netmiko is a nice tool for legacy devices that do not support structured output.

@laetrid commented on GitHub (Jul 6, 2016): Agree with jgill-arista, you can easily request data via JSON RPC from Arista, for example: ``` from jsonrpclib import Server switch = Server( "https://username:passw0rd@myswitch/command-api" ) response = switch.runCmds( 1, ["show version"] ) ``` and get response in JSON. As I understand netmiko is a nice tool for legacy devices that do not support structured output.
Author
Owner

@dinoocch commented on GitHub (Jul 6, 2016):

@jgill-arista I completely agree, the eapi is much nicer for many reasons! (I'm honestly disappointed that netmiko doesn't have the option to tie into api's, but I suppose it's beyond the scope of their project). The advantage of netmiko is support for many different devices and vendors beyond what netbox wants to/can include on it's own. Vendor specific solutions like pyeapi may work much better, but depending on the functionality we're looking for, it may not make a difference...

@dinoocch commented on GitHub (Jul 6, 2016): @jgill-arista I completely agree, the eapi is much nicer for many reasons! (I'm honestly disappointed that netmiko doesn't have the option to tie into api's, but I suppose it's beyond the scope of their project). The advantage of netmiko is support for many different devices and vendors beyond what netbox wants to/can include on it's own. Vendor specific solutions like pyeapi may work much better, but depending on the functionality we're looking for, it may not make a difference...
Author
Owner

@jeremystretch commented on GitHub (Feb 10, 2017):

Closing this out because we're going to be removing built-in RPC support in version 2.0, in favor of API-driven population via external tools.

@jeremystretch commented on GitHub (Feb 10, 2017): Closing this out because we're going to be removing built-in RPC support in version 2.0, in favor of API-driven population via external tools.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#131