

Using NESSSI from the Command Line
Authors: Roy Williams, Conrad Steenberg, Ray Plante, Joe Jacob, Matthew Graham
This tutorial explains how to run Nesssi services with a Python API on a Unix machine, in place of the alternate web-browser tools. This API requires a certificate.
1: Getting an NVO certificate
- Connect to https://nvoapp1.ncsa.uiuc.edu/protected/welcome
- If you have an NVO account already, put in your username and password on the left and click Login.
- If you do not have an NVO login, follow the registration process on the right. You will be asked for a valid email, username, and password. You have to pick up an email with a confirmation token. Go back to the first step and use your login.
- Once you have logged in, you can download a certificate. Choose the "1 year" certificate, and put something into the "Package Key". The same Key will be needed to install the certificate.
- Click on "Download Certificate". Save the file as MyNVOCert.p12 or some such name.
2: Installing the certificate
You will need the "openssl" libraries installed on your machine to convert the format of the certificate. Run the following command, where the -in parameter is the name of your certificate file.
openssl pkcs12 -nodes -out /tmp/x509up_u`id -u` -in MyNVOCert.p12
3: Download the Nesssi client
- Make a directory where you intend to write Nesssi scripts.
- Save this Python module in that directory.
4: Run some sample code
Run the test service, called sleepyadd:
$ python
>>> import nesssi_client as nesssi
>>> nesssiServer=nesssi.client('https://envoy.cacr.caltech.edu:8443/clarens/',debug=0)
>>> sessionID = nesssiServer.sleepyadd.init()
>>> print "Your session ID is", sessionID
>>> nesssiServer.sleepyadd.run(sessionID, "-time 30 -n 52 -m 344")
(wait a few seconds for the prompt)
>>> msg = nesssiServer.sleepyadd.monitor(sessionID)
>>>print msg
- The monitor method shows you a URL that includes the sessionID. This points to the sandbox corresponding to your job. Copy/paste this URL into a browser, and look at the stdout file. Your job may be queued, you may need to return to this URL later when the job has run.