Commit f9e37fa0 authored by Leigh Stoller's avatar Leigh Stoller

Add more text about using geni-lib scripts.

parent eaca5ffc
......@@ -31,9 +31,31 @@ manipulate RSpecs directly.
@section[#:tag "geni-lib"]{geni-lib}
Geni-lib is a tool that allows users to generate RSpec files from Python code.
Geni-lib is a tool that allows users to generate RSpec files from Python
code. An @bold{experimental} feature of @(tb) is the ability to use geni-lib
scripts as the definition of a profile, rather then the more primitive
RSpec format. When you supply a geni-lib script on the
@seclink["creating-profiles"]{Create Profile} page, your script is uploaded
to the server so that it can be executed in the geni-lib environment. This
allows the script to be verified for correctness, and also produces the
equivalent RSpec representation that you can view if you so desire.
When you provide a geni-lib script, you will see a slightly different set
of buttons on the @seclink["creating-profiles"]{Create Profile} page; next
to the ``Source'' button there is an ``XML'' button that will pop up the
RSpec XML for you to look at. The XML is read-only; if you want to change
the profile, you will need to change the python source code that is
displayed when you click on the ``Source'' button. Each time you change the
python source code, the script is uploaded to the server and processed. Be
sure to save your changes if you are
@seclink["updating-profiles"]{updating an existing profile}.
The following examples demonstrate basic geni-lib usage. More information
about geni-lib and additional examples, can be found in the
@hyperlink["https://bitbucket.org/barnstorm/geni-lib/src"]{geni-lib repository}.
@subsection[#:tag "geni-lib-example-1"]{A Single XEN VM node}
The following example generates an RSpec for a single XenVM node.
@codeblock|{
#; Import the ProtoGENI library.
import geni.rspec.pg as pg
......@@ -49,7 +71,7 @@ rspec.addResource(node)
printRspec(rspec)
}|
RSpec for two XenVM nodes with a LAN between them.
@subsection[#:tag "geni-lib-example-2"]{Two XenVM nodes with a LAN between them}
@codeblock|{
import geni.rspec.pg as pg
......@@ -79,7 +101,7 @@ rspec.addResource(link)
printRspec(rspec)
}|
Set a specific IP address to each node.
@subsection[#:tag "geni-lib-example-3"]{Set a specific IP address on each node}
@codeblock|{
import geni.rspec.pg as pg
......@@ -113,7 +135,7 @@ rspec.addResource(link)
printRspec(rspec)
}|
Specify an operating system and set install and execute scripts.
@subsection[#:tag "geni-lib-example-4"]{Specify an operating system and set install and execute scripts}
@codeblock|{
import geni.rspec.pg as pg
......
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