X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=emuvim%2Fexample_topology.py;h=3c53c58b0cf9232138014ddab5461444dfb7de10;hb=9686a6d137ab79039b3c886837c7eb76815cdafa;hp=ce267d5fb9aec56bdce8b0f44a16ba4581f2e083;hpb=eecafdeb81dafed69c978f77b654b9c999f8aa16;p=osm%2Fvim-emu.git diff --git a/emuvim/example_topology.py b/emuvim/example_topology.py index ce267d5..3c53c58 100644 --- a/emuvim/example_topology.py +++ b/emuvim/example_topology.py @@ -17,6 +17,7 @@ The original Mininet API has to be completely hidden and not be used by this script. """ import logging +from mininet.log import setLogLevel from dcemulator.net import DCNetwork from api.zerorpcapi import ZeroRpcApiEndpoint @@ -34,10 +35,12 @@ def create_topology1(): (each data center is one "bigswitch" in our simplified first prototype) """ - dc1 = net.addDatacenter("dc1") - dc2 = net.addDatacenter("dc2") - dc3 = net.addDatacenter("dc3") - dc4 = net.addDatacenter("dc4") + dc1 = net.addDatacenter("datacenter1") + dc2 = net.addDatacenter("datacenter2") + dc3 = net.addDatacenter("long_data_center_name3") + dc4 = net.addDatacenter( + "datacenter4", + metadata={"mydata": "we can also add arbitrary metadata to each DC"}) """ 3. You can add additional SDN switches for data center @@ -51,9 +54,9 @@ def create_topology1(): These links can use Mininet's features to limit bw, add delay or jitter. """ net.addLink(dc1, dc2) - net.addLink("dc1", s1) - net.addLink(s1, "dc3") - net.addLink(s1, dc4) + net.addLink("datacenter1", s1) + net.addLink(s1, dc3) + net.addLink(s1, "datacenter4") """ 5. We want to access and control our data centers from the outside, @@ -70,6 +73,8 @@ def create_topology1(): # connect data centers to this endpoint zapi1.connectDatacenter(dc1) zapi1.connectDatacenter(dc2) + zapi1.connectDatacenter(dc3) + zapi1.connectDatacenter(dc4) # run API endpoint server (in another thread, don't block) zapi1.start() @@ -101,6 +106,7 @@ def create_topology1(): def main(): + setLogLevel('info') # set Mininet loglevel create_topology1()