From 7cef04b206318f51407ae97d18f8dbbdeb2c2665 Mon Sep 17 00:00:00 2001 From: peusterm Date: Tue, 29 Aug 2017 19:41:13 +0200 Subject: [PATCH] added REST API endpoint to OpenStack example to have son-emu-cli working --- src/emuvim/examples/openstack_single_dc.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/emuvim/examples/openstack_single_dc.py b/src/emuvim/examples/openstack_single_dc.py index b12079d..25ef3e3 100644 --- a/src/emuvim/examples/openstack_single_dc.py +++ b/src/emuvim/examples/openstack_single_dc.py @@ -28,7 +28,7 @@ partner consortium (www.sonata-nfv.eu). import logging from mininet.log import setLogLevel from emuvim.dcemulator.net import DCNetwork - +from emuvim.api.rest.rest_api_endpoint import RestApiEndpoint from emuvim.api.openstack.openstack_api_endpoint import OpenstackApiEndpoint logging.basicConfig(level=logging.INFO) @@ -38,11 +38,16 @@ def create_topology(): net = DCNetwork(monitor=False, enable_learning=False) dc1 = net.addDatacenter("dc1") - + # add OpenStack-like APIs to the emulated DC api1 = OpenstackApiEndpoint("0.0.0.0", 6001) api1.connect_datacenter(dc1) api1.start() api1.connect_dc_network(net) + # add the command line interface endpoint to the emulated DC (REST API) + rapi1 = RestApiEndpoint("0.0.0.0", 5001) + rapi1.connectDCNetwork(net) + rapi1.connectDatacenter(dc1) + rapi1.start() net.start() net.CLI() -- 2.25.1