Merge pull request #129 from mpeuster/master
made REST API compatible with dummy gatekeeper to use them in the sam…
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 @@
'(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 @@
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 @@
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 @@
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 @@
"""
# 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 @@
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 @@
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 @@
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 @@
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