src/nepi/execution/resource.py
[nepi.git] / examples / ccn_emu_live / planetlab.py
index 5ad3080..c256b70 100644 (file)
@@ -31,20 +31,20 @@ import socket
 import os
 
 PL_NODES = dict({
-    "0": "iraplab1.iralab.uni-karlsruhe.de",
-    "1": "planetvs2.informatik.uni-stuttgart.de",
-    "2": "dfn-ple1.x-win.dfn.de",
-    "3": "planetlab2.extern.kuleuven.be",
-    "4": "mars.planetlab.haw-hamburg.de",
-    "5": "planetlab-node3.it-sudparis.eu",
-    "6": "node2pl.planet-lab.telecom-lille1.eu",
-    "7": "planetlab1.informatik.uni-wuerzburg.de",
-    "8": "planet1.l3s.uni-hannover.de",
-    "9": "planetlab1.wiwi.hu-berlin.de",
-    "10": "pl2.uni-rostock.de", 
-    "11": "planetlab1.u-strasbg.fr",
-    "12": "peeramidion.irisa.fr",
-    "13": "planetlab2.unineuchatel.ch", 
+    0: "iraplab1.iralab.uni-karlsruhe.de",
+    1: "planetvs2.informatik.uni-stuttgart.de",
+    2: "dfn-ple1.x-win.dfn.de",
+    3: "planetlab2.extern.kuleuven.be",
+    4: "mars.planetlab.haw-hamburg.de",
+    5: "planetlab-node3.it-sudparis.eu",
+    6: "node2pl.planet-lab.telecom-lille1.eu",
+    7: "planetlab1.informatik.uni-wuerzburg.de",
+    8: "planet1.l3s.uni-hannover.de",
+    9: "planetlab1.wiwi.hu-berlin.de",
+    10: "pl2.uni-rostock.de", 
+    11: "planetlab1.u-strasbg.fr",
+    12: "peeramidion.irisa.fr",
+    13: "planetlab2.unineuchatel.ch", 
     })
 
 pl_slice = os.environ.get("PL_SLICE")
@@ -76,7 +76,7 @@ def add_pl_host(ec, nid):
     hostname = PL_NODES[nid]
 
     # Add a planetlab host to the experiment description
-    host = ec.register_resource("PlanetlabNode")
+    host = ec.register_resource("planetlab::Node")
     ec.set(host, "hostname", hostname)
     ec.set(host, "username", pl_slice)
     ec.set(host, "identity", pl_ssh_key)
@@ -100,7 +100,7 @@ def add_pl_ccnd(ec, nid):
     host = ec.netgraph.node_annotation(nid, "host")
     
     # Add a CCN daemon to the planetlab node
-    ccnd = ec.register_resource("LinuxCCND")
+    ccnd = ec.register_resource("linux::CCND")
     ec.set(ccnd, "debug", 7)
     ec.register_connection(ccnd, host)
     
@@ -116,7 +116,7 @@ def add_pl_ccnr(ec, nid):
     ccnd = ec.netgraph.node_annotation(nid, "ccnd")
     
     # Add a CCN content repository to the planetlab node
-    ccnr = ec.register_resource("LinuxCCNR")
+    ccnr = ec.register_resource("linux::CCNR")
 
     ec.set(ccnr, "repoFile1", repofile)
     ec.register_connection(ccnr, ccnd)
@@ -126,7 +126,7 @@ def add_pl_ccncat(ec, nid):
     ccnd = ec.netgraph.node_annotation(nid, "ccnd")
     
     # Add a CCN cat application to the planetlab node
-    ccncat = ec.register_resource("LinuxCCNCat")
+    ccncat = ec.register_resource("linux::CCNCat")
     ec.set(ccncat, "pipeline", pipeline)
     ec.set(ccncat, "contentName", content_name)
     ec.register_connection(ccncat, ccnd)
@@ -137,7 +137,7 @@ def add_pl_fib_entry(ec, nid1, nid2):
     hostname2 = ec.netgraph.node_annotation(nid2, "hostname")
     
     # Add a FIB entry between one planetlab node and its peer
-    entry = ec.register_resource("LinuxFIBEntry")
+    entry = ec.register_resource("linux::FIBEntry")
     ec.set(entry, "host", hostname2)
     ec.register_connection(entry, ccnd1)
 
@@ -211,7 +211,7 @@ if __name__ == '__main__':
     print "Results stored at", ec.exp_dir
 
     #### Retrieve the content producing resource to wait for ot to finish
-    ccncat = ec.filter_resources("LinuxCCNCat")
+    ccncat = ec.filter_resources("linux::CCNCat")
    
     #### Run experiment until metric convergences
     rnr = ExperimentRunner()