"""This profile demonstrates a *parameterized profile* that allows you to select the type of hardware to use. You can instantiate this profile on anycluster that has that type of hardware. Instructions: Click on any node in the topology and choose the `shell` menu item.""" # Import the Portal object. import geni.portal as portal # Import the ProtoGENI library. import geni.rspec.pg as pg # Create a portal context, needed to defined parameters pc = portal.Context() # Create a Request object to start building the RSpec. request = pc.makeRequestRSpec() pc.defineParameter("hardware_type", "Optional physical node type (d710, c8220, etc)", portal.ParameterType.STRING, "") # Retrieve the values the user specifies during instantiation. params = pc.bindParameters() # Add a raw PC to the request and set the disk image. node = request.RawPC("node") if params.hardware_type != "": node.hardware_type = params.hardware_type pass # Print the RSpec to the enclosing page. pc.printRequestRSpec(request)