Good evening,

I'm working on a project where I'm required to have the information on the 
remote IP address of a Vxlan Interface configured on OVS.

Since I cannot obtain that information (at least not to my knowledge) in 
simple_switch_13.py (the switch I am using), I was following the documentation 
in 
https://ryu.readthedocs.io/en/latest/library_ovsdb.html#ryu.lib.ovs.vsctl.VSCtlCommand
 and trying to reproduce the ovs-vsctl command: "ovs-vsctl 
--columns=options,name,type list Interface", without luck.

First of all, I managed to run the following piece of code successfully:

______________________________________________________________________
from ryu.lib.ovs import vsctl

OVSDB_ADDR = 'tcp:172.16.1.10:6640'
ovs_vsctl = vsctl.VSCtl(OVSDB_ADDR)

command2 = vsctl.VSCtlCommand('list', ('Interface', 'vxlan0.2'))
ovs_vsctl.run_command([command2])
print(command2.result[0].name)
>> "vxlan0.2"
______________________________________________________________________


Then, I tried to reproduce the ovs-vsctl command I wanted, which in the OVS 
outputs to:
options             : {remote_ip="172.16.1.40"}
name                : "vxlan0.4"
type                   : vxlan

options             : {remote_ip="172.16.1.30"}
name                : "vxlan0.3"
type                   : vxlan



This is one of my many attempts:
_______________________________________________________________________________
from ryu.lib.ovs import vsctl

OVSDB_ADDR = 'tcp:172.16.1.10:6640'
ovs_vsctl = vsctl.VSCtl(OVSDB_ADDR)

command1 = vsctl.VSCtlCommand(args=('Interface'), command='list', 
options=('--columns=options'))
ovs_vsctl.run_command([command1].result[0].options)
________________________________________________________________________________


However, either the "options" argument gives an error, or result[0] does not 
have the attribute I want.... My attempts have been endless. I've also been 
searching through vsctl.py code to try and find a solution for the structure, 
but I simply cannot understand how to formulate the command. Please help me on 
this, I've been stuck for a long time...


_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to