Skip to main content

A Python3 OVSDB API

Project description

Ovsdb Manager

OvSDB Manager is an OpenVSwitch Database Protocol (OVSDB) Python Client developed by the i2CAT Foundation (Barcelona). It implements the basic functionalities to interact with OpenVSwitch switches (addport, delete port , add bridge, delete bridge, etc).

Author: Ferran Cañellas ferran.canellas@i2cat.net

Requirements

  • Python 3.5 or greater

Installation

If you are using PiP:

pip install ovsdbmanager

Otherwise, you can clone this repo and install the module manually.

git clone https://github.com/Fundacio-i2CAT/ovsdb-manager.git
cd ovsdb-manager
python3 setup.py install

Usage

To start using Ovsdb Manager simply do

from ovsdbmanager import OvsdbManager
ovs = OvsdbManager(ip="X.X.X.X", port="Y")

If you are running the OVSDB server locally you can ommit the IP address. The default port is 6640.

Examples of use:

from ovsdbmanager import OvsdbManager
from ovsdbmanager.db.bridge import FailMode
from ovsdbmanager.db.controller import ConnectionMode

ovs = OvsdbManager(ip="X.X.X.X", port="Y")

# Create a bridge
br1 = ovs.add_bridge("br1")

# Add a port
p1 = br1.add_port("p1")

# Delete a port
br1.del_port(p1)

# Set controller
ctrl = br1.set_controller("tcp:10.0.10.1:6653")

# Set controller's connection mode as out of band
ctrl.set_connection_mode(ConnectionMode.OUTOFBAND)

# Set fail mode as secure
br1.set_fail_mode(FailMode.SECURE)

# Enable RSTP
br1.set_rstp(True)

# Add a patch port
br1.add_port("p2", patch_peer="p3")

# Delete a bridge
ovs.del_bridge(br1)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovsdbmanager-0.1.6.tar.gz (9.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ovsdbmanager-0.1.6-py3.8.egg (53.2 kB view details)

Uploaded Egg

ovsdbmanager-0.1.6-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file ovsdbmanager-0.1.6.tar.gz.

File metadata

  • Download URL: ovsdbmanager-0.1.6.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6

File hashes

Hashes for ovsdbmanager-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a8079197502bdea9818f0c7089809c274959a9182e6e250ce77ec945d528f8ee
MD5 f60499d74bbbd702f666586bc08ef7be
BLAKE2b-256 0d686332f7295a8b4e5bbeb781c7bdf672e54ebc69a399bfc06872a13c2ad2f7

See more details on using hashes here.

File details

Details for the file ovsdbmanager-0.1.6-py3.8.egg.

File metadata

  • Download URL: ovsdbmanager-0.1.6-py3.8.egg
  • Upload date:
  • Size: 53.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6

File hashes

Hashes for ovsdbmanager-0.1.6-py3.8.egg
Algorithm Hash digest
SHA256 3e24c69fcc9bea440d7aaf18885d0c181b31d7af123a20035c3cb3fa0ca223e8
MD5 6db7ed10f6253673e46a42c2a6328d3c
BLAKE2b-256 76503d1f6c612f0a82af2a6870c508195316d21480861fdcce649e26c78b5444

See more details on using hashes here.

File details

Details for the file ovsdbmanager-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: ovsdbmanager-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6

File hashes

Hashes for ovsdbmanager-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9b799cc1820db99eb1ee8fd8d1d22990b5056160e451c8ad39ae7ffaf10f491b
MD5 39bfe7756233fd51a79ea7a8e1b7890e
BLAKE2b-256 77c30fd38e6b405ebb2cdf0f50a625f0eca12f197963368eb72ca15a316f646d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page