Commit 6a962d51 authored by Keith Downie's avatar Keith Downie

Added section for geni-lib in Advanced Topics along with some initial script examples for review

parent 51b86cd3
......@@ -26,9 +26,59 @@ there are still some cases in which it is unfortunately useful to look at or
manipulate RSpecs directly.
@italic{Still to come: documentation of @(tb)'s extensions to the RSpec format.}
@section[#:tag "geni-lib"]{geni-lib}
Geni-lib is a tool that allows users to generate RSpec files from Python code.
The following example generates an RSpec for a single XenVM node.
#; Import the ProtoGENI library.
import as pg
#; Create a Request object to start building the RSpec.
rspec = pg.Request()
#; Create a XenVM and add it to the RSpec.
node = pg.XenVM("node")
#; Save the RSpec as the file rspec.xml.
RSpec for two XenVM nodes with a LAN between them.
import as pg
rspec = pg.Request()
#; Create a XenVM nodes.
node1 = pg.XenVM("node1")
node2 = pg.XenVM("node2")
#; Create interfaces for each node.
iface1 = node1.addInterface("if1")
iface2 = node2.addInterface("if2")
#; Create a link with the type of LAN.
link = pg.LAN("lan")
#; Add both node interfaces to the link.
#; Add the link to the RSpec.
@section[#:tag "public-ip-access"]{Public IP Access}
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