[ovs-discuss] Automating ovs using an API or similar

Semba, Kurt ksemba at enterasys.com
Tue Feb 22 13:24:51 UTC 2011


Hey Justin,

thanks for that hint - yes, there are JSON-RPC libraries for Java out there which I could probably use for this. If I understand this correctly, my application would act as the JSON-RPC client and the XenServer running the ovs would act as the Server? I would need to set my remote machine as a new "manager" using the tcp-ip settings (we'll sort out SSL if the basics work :) )?

Looking at the documentation regarding the ovsdb it seems as my client would need to know about all DB tables, columns and rows and modify them using specific JSON-RPC calls - correct? If that is the case, it would be more complex as I thought of. I would have expected to be able call pre-defined RPC calls like for example "addPortToBridge(Bridge br, Port br)" or similar. Do you have an implementation of such a manager (even if it's not in Java) so I could see how such a manager uses the RPC calls to create / delete VLANs ports, bridges, etc.?

Thanks again
Kurt

-----Original Message-----
From: Justin Pettit [mailto:jpettit at nicira.com] 
Sent: Dienstag, 22. Februar 2011 09:17
To: Semba, Kurt
Cc: discuss at openvswitch.org
Subject: Re: [ovs-discuss] Automating ovs using an API or similar

On Feb 21, 2011, at 11:43 PM, Semba, Kurt wrote:

> thanks for your reply and your advice. I'm using the following SDK/library within my Java application:
> http://www.community.citrix.com/cdn/xs/sdks

Yes, that would be XAPI, which I mentioned earlier.  (Or at least, that's what we call it.  The term is a bit overloaded in XenServer, and it appears that the API itself has a couple slight variations.)  I've only used the Python bindings, but I imagine the Java ones are quite similarly straight-forward.

> I would prefer using libraries which I can compile into my code instead of using calls to external tools like ovs-vsctl. Where exactly do I find the documentation on implementing my own ovsdb-server (I don't know where to find "ovsdb/SPECS" - sorry, stupid me). How much effort would you think it is to build something like this in Java?

I'd recommend using ovsdb-server, since it runs alongside the ovs-vswitchd process.  I was suggesting that if you wanted to centralize control that you may consider implementing a manager that speaks its protocol.  I don't know of any Java bindings to the database (either local or remote).  I would imagine it would be a moderate task to build, but it does appear that there are at least Java bindings for JSON-RPC, which would help.

That "ovsdb/SPECS", which defines the protocol, was relative to the root directory of the source distribution.  You can also view that file online here:

	http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob;f=ovsdb/SPECS

Good luck!

--Justin








More information about the discuss mailing list