From: peusterm Date: Tue, 29 Aug 2017 17:41:13 +0000 (+0200) Subject: added REST API endpoint to OpenStack example to have son-emu-cli working X-Git-Tag: v3.1~13^2~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=7cef04b206318f51407ae97d18f8dbbdeb2c2665;p=osm%2Fvim-emu.git added REST API endpoint to OpenStack example to have son-emu-cli working --- 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()