def get_ovn_conn(viewer): _nb_idl = OvnIdl(constants.OVN_NB_CONNECTION, 'OVN_Northbound', viewer) _nb_conn = connection.Connection( _nb_idl, timeout=constants.OVSDB_CONNECTION_TIMEOUT) ovn_nb = nb_impl_idl.OvnNbApiIdlImpl(_nb_conn, start=True) _sb_idl = OvnIdl(constants.OVN_SB_CONNECTION, 'OVN_Southbound', viewer) _sb_conn = connection.Connection( _sb_idl, timeout=constants.OVSDB_CONNECTION_TIMEOUT) ovn_sb = nb_impl_idl.OvnNbApiIdlImpl(_sb_conn, start=True) return ovn_nb, ovn_sb
def setUp(self): super(OvnSouthboundTest, self).setUp() self.api = impl_idl.OvnSbApiIdlImpl(self.connection['OVN_Southbound']) self.nbapi = nbidl.OvnNbApiIdlImpl(self.connection['OVN_Northbound']) self.handler = ovsdb_event.RowEventHandler() self.api.idl.notify = self.handler.notify
def setUp(self): super(TestOvnNbIndex, self).setUp() self.api = impl_idl.OvnNbApiIdlImpl(self.connection) self.lsp_name = str(uuid.uuid4()) self.a = None
def setUp(self): super(TestOvnNbIndex, self).setUp() self.api = impl_idl.OvnNbApiIdlImpl(self.connection)
from __future__ import print_function import sys from ovsdbapp.backend.ovs_idl import connection from ovsdbapp.schema.ovn_northbound import impl_idl conn = "tcp:127.0.0.1:6641" print("Connecting to", conn, file=sys.stderr) # The python-ovs Idl class i = connection.OvsdbIdl.from_server(conn, 'OVN_Northbound') # The ovsdbapp Connection object c = connection.Connection(i, 5) # The OVN_Northbound API implementation object api = impl_idl.OvnNbApiIdlImpl(c) # If we only wanted to delete the acls.... # with api.transaction(check_error=True) as txn: # txn.add(api.acl_del("sw1")) # txn.add(api.acl_del("sw0")) with api.transaction(check_error=True) as txn: for ls_row in api.tables['Logical_Switch'].rows: txn.add(api.acl_del(ls_row)) txn.add(api.ls_del(ls_row)) for lr_row in api.lr_list().execute(check_error=True): txn.add(api.lr_del(lr_row.uuid)) # Loop through rows returned from an API call (very boring after removals :))
def setUp(self): super(OvnNorthboundTest, self).setUp() self.api = impl_idl.OvnNbApiIdlImpl(self.connection)