Merge "Add LrGet command"

This commit is contained in:
Zuul 2018-01-05 10:02:27 +00:00 committed by Gerrit Code Review
commit f674dfd254
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,