From 0a336cc612849715b03a513a7b4668d30542b5d6 Mon Sep 17 00:00:00 2001 From: peusterm Date: Mon, 4 Jul 2016 09:15:47 +0200 Subject: [PATCH] made REST API compatible with dummy gatekeeper to use them in the same topology --- src/emuvim/cli/rest/compute.py | 2 +- src/emuvim/cli/rest/datacenter.py | 2 +- src/emuvim/cli/rest/monitor.py | 2 +- src/emuvim/cli/rest/network.py | 2 +- src/emuvim/examples/simple_topology.py | 2 +- src/emuvim/examples/simple_topology_restapi.py | 2 +- src/emuvim/examples/sonata_y1_demo_topology_1.py | 12 ++++++------ src/emuvim/test/api_base.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/emuvim/cli/rest/compute.py b/src/emuvim/cli/rest/compute.py index 29e65dc..4a20ca9 100755 --- a/src/emuvim/cli/rest/compute.py +++ b/src/emuvim/cli/rest/compute.py @@ -121,7 +121,7 @@ parser.add_argument( '(id=input,ip=10.0.10.3/24),(id=output,ip=10.0.10.4/24)' for multiple interfaces.") parser.add_argument( "--endpoint", "-e", dest="endpoint", - default="http://127.0.0.1:5000", + default="http://127.0.0.1:5001", help="UUID of the plugin to be manipulated.") def main(argv): diff --git a/src/emuvim/cli/rest/datacenter.py b/src/emuvim/cli/rest/datacenter.py index b43a445..7927365 100755 --- a/src/emuvim/cli/rest/datacenter.py +++ b/src/emuvim/cli/rest/datacenter.py @@ -63,7 +63,7 @@ parser.add_argument( help="Data center to which the command should be applied.") parser.add_argument( "--endpoint", "-e", dest="endpoint", - default="http://127.0.0.1:5000", + default="http://127.0.0.1:5001", help="UUID of the plugin to be manipulated.") diff --git a/src/emuvim/cli/rest/monitor.py b/src/emuvim/cli/rest/monitor.py index 2ed1402..5656c41 100755 --- a/src/emuvim/cli/rest/monitor.py +++ b/src/emuvim/cli/rest/monitor.py @@ -101,7 +101,7 @@ parser.add_argument( help="Data center where the vnf is deployed") parser.add_argument( "--endpoint", "-e", dest="endpoint", - default="http://127.0.0.1:5000", + default="http://127.0.0.1:5001", help="UUID of the plugin to be manipulated.") def main(argv): diff --git a/src/emuvim/cli/rest/network.py b/src/emuvim/cli/rest/network.py index e7687f6..e74427b 100755 --- a/src/emuvim/cli/rest/network.py +++ b/src/emuvim/cli/rest/network.py @@ -100,7 +100,7 @@ parser.add_argument( help="cookie for this flow, as easy to use identifier (eg. per tenant/service)") parser.add_argument( "--endpoint", "-e", dest="endpoint", - default="http://127.0.0.1:5000", + default="http://127.0.0.1:5001", help="UUID of the plugin to be manipulated.") def main(argv): diff --git a/src/emuvim/examples/simple_topology.py b/src/emuvim/examples/simple_topology.py index 5460909..8f940fc 100755 --- a/src/emuvim/examples/simple_topology.py +++ b/src/emuvim/examples/simple_topology.py @@ -78,7 +78,7 @@ def create_topology1(): """ # create a new instance of a endpoint implementation zapi1 = ZeroRpcApiEndpoint("0.0.0.0", 4242) - rapi1 = RestApiEndpoint("127.0.0.1", 5000) + rapi1 = RestApiEndpoint("127.0.0.1", 5001) # connect data centers to this endpoint zapi1.connectDatacenter(dc1) zapi1.connectDatacenter(dc2) diff --git a/src/emuvim/examples/simple_topology_restapi.py b/src/emuvim/examples/simple_topology_restapi.py index f3125f1..440a085 100755 --- a/src/emuvim/examples/simple_topology_restapi.py +++ b/src/emuvim/examples/simple_topology_restapi.py @@ -87,7 +87,7 @@ def create_topology1(): zapi1.start() # create a new instance of a endpoint implementation - api1 = RestApiEndpoint("127.0.0.1", 5000) + api1 = RestApiEndpoint("127.0.0.1", 5001) # connect data centers to this endpoint api1.connectDatacenter(dc1) api1.connectDatacenter(dc2) diff --git a/src/emuvim/examples/sonata_y1_demo_topology_1.py b/src/emuvim/examples/sonata_y1_demo_topology_1.py index 0236b8d..69e7d0b 100755 --- a/src/emuvim/examples/sonata_y1_demo_topology_1.py +++ b/src/emuvim/examples/sonata_y1_demo_topology_1.py @@ -7,7 +7,7 @@ A simple topology with two PoPs for the y1 demo story board. import logging from mininet.log import setLogLevel from emuvim.dcemulator.net import DCNetwork -from emuvim.api.zerorpc.compute import ZeroRpcApiEndpoint +from emuvim.api.rest.rest_api_endpoint import RestApiEndpoint from emuvim.api.sonata import SonataDummyGatekeeperEndpoint from mininet.node import RemoteController @@ -23,12 +23,12 @@ def create_topology1(): net.addLink(dc1, s1, delay="10ms") net.addLink(dc2, s1, delay="20ms") - # add the command line interface endpoint to each DC - zapi1 = ZeroRpcApiEndpoint("0.0.0.0", 4242) - zapi1.connectDatacenter(dc1) - zapi1.connectDatacenter(dc2) + # add the command line interface endpoint to each DC (REST API) + rapi1 = RestApiEndpoint("0.0.0.0", 5001) + rapi1.connectDatacenter(dc1) + rapi1.connectDatacenter(dc2) # run API endpoint server (in another thread, don't block) - zapi1.start() + rapi1.start() # add the SONATA dummy gatekeeper to each DC sdkg1 = SonataDummyGatekeeperEndpoint("0.0.0.0", 5000) diff --git a/src/emuvim/test/api_base.py b/src/emuvim/test/api_base.py index e7ab297..fe17bc9 100755 --- a/src/emuvim/test/api_base.py +++ b/src/emuvim/test/api_base.py @@ -40,7 +40,7 @@ class SimpleTestTopology(unittest.TestCase): specific controller functionality. """ self.net = DCNetwork(controller=controller, **kwargs) - self.api = RestApiEndpoint("127.0.0.1",5000) + self.api = RestApiEndpoint("127.0.0.1", 5001) # add some switches # start from s1 because ovs does not like to have dpid = 0 # and switch name-number is being used by mininet to set the dpid -- 2.25.1