From c038a994d056758c352139055d1448e4b0124a24 Mon Sep 17 00:00:00 2001 From: peusterm Date: Fri, 1 Jul 2016 12:15:58 +0200 Subject: [PATCH] added REST endpoint to default topo example to let it work with the CLI --- src/emuvim/examples/simple_topology.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/emuvim/examples/simple_topology.py b/src/emuvim/examples/simple_topology.py index eb52cb1..5460909 100755 --- a/src/emuvim/examples/simple_topology.py +++ b/src/emuvim/examples/simple_topology.py @@ -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 -- 2.25.1