Add LrGet command

Change-Id: Icc99121fb8c013bfd1097df79630c888c7b5c0dd
Signed-off-by: Marcin Mirecki <mmirecki@redhat.com>
This commit is contained in:
Marcin Mirecki 2017-09-20 09:29:45 +02:00
parent 9a2cd1af3c
commit 6b5b3bda6c
3 changed files with 14 additions and 0 deletions

View File

@ -363,6 +363,13 @@ class API(api.API):
:returns: :class:`Command` with RowView list result
"""
@abc.abstractmethod
def lr_get(self, router):
"""Get logical router for 'router'
:returns: :class:`Command` with RowView result
"""
@abc.abstractmethod
def lrp_add(self, router, port, mac, networks, peer=None, may_exist=False,
**columns):

View File

@ -551,6 +551,10 @@ class LrListCommand(cmd.BaseCommand):
r in self.api.tables['Logical_Router'].rows.values()]
class LrGetCommand(cmd.BaseGetRowCommand):
table = 'Logical_Router'
class LrpAddCommand(cmd.BaseCommand):
def __init__(self, api, router, port, mac, networks,
peer=None, may_exist=False, **columns):

View File

@ -133,6 +133,9 @@ class OvnNbApiIdlImpl(ovs_idl.Backend, api.API):
def lr_list(self):
return cmd.LrListCommand(self)
def lr_get(self, router):
return cmd.LrGetCommand(self, router)
def lrp_add(self, router, port, mac, networks, peer=None, may_exist=False,
**columns):
return cmd.LrpAddCommand(self, router, port, mac, networks,