Posted on May 1, 2017 5:47 pm
 |  Asked by harikrishna patnala
 |  464 views
0
0
Print Friendly, PDF & Email

Hi,

When I’m trying to use Arista veos eapi to configure vlan on an interface using multiple commands, it is failing (single command is working fine like “show vlan”, “show version”). It is not showing any response and in the background also configuration is not happening on the virtual switch. Please help me if I’m missing anything.

I’m using VEOS (virtual switch) for my testing. Following are commands I’ve used and attached the screenshot of eapi.

Thanks in advance

 

enable
configure
interface Ethernet1
switchport access vlan 745
show vlan 745

It appears that you have not created vlan 745 based on the JSON results. Please create vlan 745 first and then you should get the results you are looking for.

(Jeremy Georges at May 1, 2017 2:24 pm)

Please note the following example:
{
”jsonrpc”: ”2.0”,
”method”: ”runCmds”,
”params”: {
”format”: ”json”,
”timestamps”: false,
”autoComplete”: false,
”expandAliases”: false,
”cmds”: [
”enable”,
”configure”,
”vlan 745”,
”interface ethernet1”,
”switchport access vlan 745”,
”show vlan 745”
],
”version”: 1
},
”id”: ”EapiExplorer-1”
}

Then the result:

{
”jsonrpc”: ”2.0”,
”id”: ”EapiExplorer-1”,
”result”: [
{},
{},
{},
{},
{},
{
”sourceDetail”: ””,
”vlans”: {
”745”: {
”status”: ”active”,
”name”: ”VLAN0745”,
”interfaces”: {
”Ethernet2”: {
”privatePromoted”: false
}
},
”dynamic”: false
}
}
}
]

(Jeremy Georges at May 1, 2017 2:25 pm)

Post your Answer

You must be logged in to post an answer.