From 6b5b3bda6ce591e422bfb9baeff870c29bce6f6f Mon Sep 17 00:00:00 2001 From: Marcin Mirecki Date: Wed, 20 Sep 2017 09:29:45 +0200 Subject: [PATCH] Add LrGet command Change-Id: Icc99121fb8c013bfd1097df79630c888c7b5c0dd Signed-off-by: Marcin Mirecki --- ovsdbapp/schema/ovn_northbound/api.py | 7 +++++++ ovsdbapp/schema/ovn_northbound/commands.py | 4 ++++ ovsdbapp/schema/ovn_northbound/impl_idl.py | 3 +++ 3 files changed, 14 insertions(+) diff --git a/ovsdbapp/schema/ovn_northbound/api.py b/ovsdbapp/schema/ovn_northbound/api.py index 7f7ad7cf..c4fe2563 100644 --- a/ovsdbapp/schema/ovn_northbound/api.py +++ b/ovsdbapp/schema/ovn_northbound/api.py @@ -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): diff --git a/ovsdbapp/schema/ovn_northbound/commands.py b/ovsdbapp/schema/ovn_northbound/commands.py index a1959a9d..b58cb507 100644 --- a/ovsdbapp/schema/ovn_northbound/commands.py +++ b/ovsdbapp/schema/ovn_northbound/commands.py @@ -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): diff --git a/ovsdbapp/schema/ovn_northbound/impl_idl.py b/ovsdbapp/schema/ovn_northbound/impl_idl.py index 9f292de6..37a16fd4 100644 --- a/ovsdbapp/schema/ovn_northbound/impl_idl.py +++ b/ovsdbapp/schema/ovn_northbound/impl_idl.py @@ -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,