Add new API calls for various uses
Change-Id: I2d8c16d74cb7678b8d09722b2702eadfa9536093
diff --git a/db/db.py b/db/db.py
index 870619c..7ef3c87 100644
--- a/db/db.py
+++ b/db/db.py
@@ -268,6 +268,15 @@
def get_ports_by_switch(self, switch_id):
return self._get_multi_elements("port_id", "port", "switch_id", switch_id)
+ def get_port_by_switch_and_name(self, switch_id, name):
+ return self._get_element2("port_id", "port", "switch_id", switch_id, "name", name)
+
+ def get_ports_by_current_vlan(self, vlan_id):
+ return self._get_multi_elements("port_id", "port", "current_vlan_id", vlan_id)
+
+ def get_ports_by_base_vlan(self, vlan_id):
+ return self._get_multi_elements("port_id", "port", "base_vlan_id", vlan_id)
+
def get_vlan_name(self, vlan_id):
return self._get_element("vlan_name", "vlan", "vlan_id", vlan_id)