Sun N1 Service Provisioning System 5.2 Command-Line Interface Reference Manual

ProcedureHow to Run the CLI Jython Interpreter

Steps
  1. From a server where the CLI Client and Jython are installed, start the CLI Jython Interpreter.


    ./cr_clij
  2. Include the following code at the beginning of your script.


    from clui import *
    app=PyCLUI() 
    app.execStr(CLI command) 	
    app.close()

    The assignment app=PyCLUI() calls the CLI. The App.close() call deletes the instance of this Jython class.


    Note –

    Only the execStr and execRaw calls are supported for SPS scripts with Jython. The returned objects from execRaw can only be used as parameters for other execRaw calls. If you attempt to use an object returned from an execRaw call as a parameter to an execStr call, the call fails. You can use the toString() method of the object to construct the string to feed to the execStr call.