FIX: Data centers now have a user defined label (to be identified) but use a short...
[osm/vim-emu.git] / emuvim / example_topology.py
index 0117fa7..3c49f99 100644 (file)
@@ -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,10 @@ 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("a_very_long_data_center_name3")
+    dc4 = net.addDatacenter("datacenter4")
 
     """
     3. You can add additional SDN switches for data center
@@ -51,9 +52,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,
@@ -75,7 +76,7 @@ def create_topology1():
 
     """
     5.1. For our example, we create a second endpoint to illustrate that
-         this is support by our design. This feature allows us to have
+         this is supported by our design. This feature allows us to have
          one API endpoint for each data center. This makes the emulation
          environment more realistic because you can easily create one
          OpenStack-like REST API endpoint for *each* data center.
@@ -101,6 +102,7 @@ def create_topology1():
 
 
 def main():
+    setLogLevel('info')  # set Mininet loglevel
     create_topology1()