added REST endpoint to default topo example to let it work with the CLI
authorpeusterm <manuel.peuster@uni-paderborn.de>
Fri, 1 Jul 2016 10:15:58 +0000 (12:15 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Fri, 1 Jul 2016 10:15:58 +0000 (12:15 +0200)
src/emuvim/examples/simple_topology.py

index eb52cb1..5460909 100755 (executable)
@@ -20,6 +20,7 @@ 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.zerorpc.network import ZeroRpcApiEndpointDCNetwork
 
 logging.basicConfig(level=logging.INFO)
@@ -77,13 +78,19 @@ 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)
     # connect data centers to this endpoint
     zapi1.connectDatacenter(dc1)
     zapi1.connectDatacenter(dc2)
     zapi1.connectDatacenter(dc3)
     zapi1.connectDatacenter(dc4)
+    rapi1.connectDatacenter(dc1)
+    rapi1.connectDatacenter(dc2)
+    rapi1.connectDatacenter(dc3)
+    rapi1.connectDatacenter(dc4)
     # run API endpoint server (in another thread, don't block)
     zapi1.start()
+    rapi1.start()
 
     """
     5.1. For our example, we create a second endpoint to illustrate that