
This commit enable users to run `tox -e docs` to build docs for os-ken. It fixes several issues to ensure the build will succeed. In addition, the docs from upstream Ryu library is grouped into archived content. The future work is merging those docs into the os-ken contents. Change-Id: I5ee1998e0d2835495650cda530eb0b73c49b091a
2.0 KiB
2.0 KiB
OVSDB library
Path: os_ken.lib.ovs
Similar to the library_ovsdb_manager
, this library enables your
application to speak the OVSDB protocol (RFC7047), but differ from
the library_ovsdb_manager
, this library will initiate
connections from controller side as ovs-vsctl
command does. Please make sure that your devices are listening on either
the Unix domain socket or TCP/SSL port before calling the APIs of this
library.
# Show current configuration
$ ovs-vsctl get-manager
# Set TCP listen address
$ ovs-vsctl set-manager "ptcp:6640"
See manpage of ovs-vsctl command for more details.
Basic Usage
- Instantiate :py
os_ken.lib.ovs.vsctl.VSCtl
. - Construct commands with :py
os_ken.lib.ovs.vsctl.VSCtlCommand
. The syntax is almost the same as ovs-vsctl command. - Execute commands via :py
os_ken.lib.ovs.vsctl.VSCtl.run_command
.
Example
from os_ken.lib.ovs import vsctl
= 'tcp:127.0.0.1:6640'
OVSDB_ADDR = vsctl.VSCtl(OVSDB_ADDR)
ovs_vsctl
# Equivalent to
# $ ovs-vsctl show
= vsctl.VSCtlCommand('show')
command
ovs_vsctl.run_command([command])print(command)
# >>> VSCtlCommand(args=[],command='show',options=[],result='830d781f-c3c8-4b4f-837e-106e1b33d058\n ovs_version: "2.8.90"\n')
# Equivalent to
# $ ovs-vsctl list Port s1-eth1
= vsctl.VSCtlCommand('list', ('Port', 's1-eth1'))
command
ovs_vsctl.run_command([command])print(command)
# >>> VSCtlCommand(args=('Port', 's1-eth1'),command='list',options=[],result=[<ovs.db.idl.Row object at 0x7f525fb682e8>])
print(command.result[0].name)
# >>> s1-eth1
API Reference
os_ken.lib.ovs.vsctl
os_ken.lib.ovs.vsctl
os_ken.lib.ovs.bridge
os_ken.lib.ovs.bridge