Add Queries For BGP Route Lookups

This patch contains code for looking in the Neutron DB and identifying
next-hops for tenant networks and floating IP's. These queries use the
centralized router as the next-hop and ignore host routes attached to
a distributed router.

Partially-Implements: blueprint bgp-dynamic-routing
Co-Authored-By: vikram.choudhary <vikram.choudhary@huawei.com>
Change-Id: If08d6595d9bc657a7ecfb487e8df40860837d200
diff --git a/neutron/tests/tempest/services/network/json/network_client.py b/neutron/tests/tempest/services/network/json/network_client.py
index 9f6ad7a..3cadcbb 100644
--- a/neutron/tests/tempest/services/network/json/network_client.py
+++ b/neutron/tests/tempest/services/network/json/network_client.py
@@ -320,6 +320,22 @@
         body = json.loads(body)
         return service_client.ResponseBody(resp, body)
 
+    def get_bgp_advertised_routes(self, bgp_speaker_id):
+        base_uri = '%s/bgp-speakers/%s/get_advertised_routes'
+        uri = base_uri % (self.uri_prefix, bgp_speaker_id)
+        resp, body = self.get(uri)
+        body = {'advertised_routes': self.deserialize_list(body)}
+        self.expected_success(200, resp.status)
+        return service_client.ResponseBody(resp, body)
+
+    def get_bgp_router_routes(self, router_id):
+        base_uri = '%s/router-routes/%s'
+        uri = base_uri % (self.uri_prefix, router_id)
+        resp, body = self.get(uri)
+        body = self.deserialize_list(body)
+        self.expected_success(200, resp.status)
+        return service_client.ResponseBody(resp, body)
+
     # Common methods that are hard to automate
     def create_bulk_network(self, names, shared=False):
         network_list = [{'name': name, 'shared': shared} for name in names]