Commit ddec9a88 authored by Robert Ricci's avatar Robert Ricci

Remove now-unused code samples

parent 6291a0aa
Pipeline #2498 failed with stages
in 2 minutes
# Request a pool of 3 dynamic IP addresses
pool = AddressPool( "poolname", 3 )
rspec.addResource( pool )
"""An example of constructing a profile with a single raw PC.
Instructions:
Wait for the profile instance to start, and then log in to the host via the
ssh port specified below.
"""
import geni.portal as portal
import geni.rspec.pg as rspec
# Create a Request object to start building the RSpec.
request = portal.context.makeRequestRSpec()
# Create a raw PC
node = request.RawPC("node")
# Print the RSpec to the enclosing page.
portal.context.printRequestRSpec()
"""An example of constructing a profile with a single Xen VM.
Instructions:
Wait for the profile instance to start, and then log in to the VM via the
ssh port specified below. (Note that in this case, you will need to access
the VM through a high port on the physical host, since we have not requested
a public IP address for the VM itself.)
"""
import geni.portal as portal
import geni.rspec.pg as rspec
# Create a Request object to start building the RSpec.
request = portal.context.makeRequestRSpec()
# Create a XenVM
node = request.XenVM("node")
# Ask for two cores
node.cores = 2
# Ask for 2GB of ram
node.ram = 2048
# Add an extra 8GB virtual disk.
node.disk = 8
# Print the RSpec to the enclosing page.
portal.context.printRequestRSpec()
"""An example of constructing a profile with a single Xen VM.
Instructions:
Wait for the profile instance to start, and then log in to the VM via the
ssh port specified below. (Note that in this case, you will need to access
the VM through a high port on the physical host, since we have not requested
a public IP address for the VM itself.)
"""
import geni.portal as portal
import geni.rspec.pg as rspec
# Create a Request object to start building the RSpec.
request = portal.context.makeRequestRSpec()
# Add a XenVM (named "node") to the request
node = request.XenVM("node")
# Write the request in RSpec format
portal.context.printRequestRSpec()
"""An example of constructing a profile with two ARM64 nodes connected by a LAN.
Instructions:
Wait for the profile instance to start, and then log in to either host via the
ssh ports specified below.
"""
import geni.portal as portal
import geni.rspec.pg as rspec
request = portal.context.makeRequestRSpec()
# Create two raw "PC" nodes
node1 = request.RawPC("node1")
node2 = request.RawPC("node2")
# Set each of the two to specifically request "m400" nodes, which in CloudLab, are ARM
node1.hardware_type = "m400"
node2.hardware_type = "m400"
# Create interfaces for each node.
iface1 = node1.addInterface("if1")
iface2 = node2.addInterface("if2")
# Create a link with type LAN.
link = request.LAN("lan")
# Add both node interfaces to the link.
link.addInterface(iface1)
link.addInterface(iface2)
portal.context.printRequestRSpec()
"""An example of constructing a profile with two VMs connected by a LAN.
Instructions:
Wait for the profile instance to start, and then log in to either VM via the
ssh ports specified below.
"""
import geni.portal as portal
import geni.rspec.pg as rspec
request = portal.context.makeRequestRSpec()
# Create two XenVM nodes.
node1 = request.XenVM("node1")
node2 = request.XenVM("node2")
# Create interfaces for each node.
iface1 = node1.addInterface("if1")
iface2 = node2.addInterface("if2")
# Create a link with the type of LAN.
link = request.LAN("lan")
# Add both node interfaces to the link.
link.addInterface(iface1)
link.addInterface(iface2)
portal.context.printRequestRSpec()
#!/usr/bin/python
"""
An example of a minimal OpenEPC profile.
Instructions:
Five nodes will be instantiated by this profile: three packet core
nodes, and two emulated RAN nodes (one eNodeB and one UE). Please
refer to the OpenEPC documentation for instructions on how to
operate OpenEPC.
"""
# Import the standard RSpec and portal modules
import geni.portal as portal
import geni.rspec.pg as rspec
# Import phantoment-specific functionality
import geni.rspec.emulab.pnext as pn
request = portal.context.makeRequestRSpec()
# Create OpenEPC nodes; nodes made with this helper function must
# be explicitly added to request after creating them
epcen = pn.mkepcnode( "epc", pn.EPCROLES.ENABLERS )
request.addResource( epcen )
pgw = pn.mkepcnode( "pgw", pn.EPCROLES.PGW )
request.addResource( pgw )
sgw = pn.mkepcnode( "sgw", pn.EPCROLES.SGW_MME_SGSN )
request.addResource( sgw )
enodeb = pn.mkepcnode( "enodeb", pn.EPCROLES.ENODEB )
request.addResource( enodeb )
ue = pn.mkepcnode( "ue", pn.EPCROLES.CLIENT )
request.addResource( ue )
# Create LANs:
mgmt = request.EPClan( pn.EPCLANS.MGMT )
net_a = request.EPClan( pn.EPCLANS.NET_A )
net_b = request.EPClan( pn.EPCLANS.NET_B )
net_d = request.EPClan( pn.EPCLANS.NET_D )
an_lte = request.EPClan( pn.EPCLANS.AN_LTE )
# Add nodes to appropriate LANs:
mgmt.addMember( epcen )
mgmt.addMember( pgw )
mgmt.addMember( sgw )
mgmt.addMember( enodeb )
mgmt.addMember( ue )
net_a.addMember( epcen )
net_a.addMember( pgw )
net_b.addMember( pgw )
net_b.addMember( sgw )
net_d.addMember( sgw )
net_d.addMember( enodeb )
an_lte.addMember( enodeb )
an_lte.addMember( ue )
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