Commit b7144300 authored by Robert Ricci's avatar Robert Ricci

Convert an example that I had missed to the new style

parent 41f4aa47
......@@ -6,30 +6,23 @@ ssh ports specified below.
"""
import geni.portal as portal
import geni.rspec.pg as pg
import geni.rspec.pg as rspec
pc = portal.Context()
rspec = pg.Request()
request = portal.context.makeRequestRSpec()
# Create two XenVM nodes.
node1 = pg.XenVM("node1")
node2 = pg.XenVM("node2")
node1 = request.XenVM("node1")
node2 = request.XenVM("node2")
# Create interfaces for each node.
iface1 = node1.addInterface("if1")
iface2 = node2.addInterface("if2")
rspec.addResource(node1)
rspec.addResource(node2)
# Create a link with the type of LAN.
link = pg.LAN("lan")
link = request.LAN("lan")
# Add both node interfaces to the link.
link.addInterface(iface1)
link.addInterface(iface2)
# Add the link to the RSpec.
rspec.addResource(link)
pc.printRequestRSpec(rspec)
portal.context.printRequestRSpec()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment