N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual

Running the Command-Line Interface

To execute one CLI command at a time, use the cr_cli tool. This tool invokes the CLI in single-line command mode.

Single-line command mode accepts one command at a time as input. Each command submitted must be complete, you are not interactively prompted for the next input parameter. When operating in this mode, the Command Line Execution Client does not maintain a command history.

cr_cli commands can be stored in a file and called from a shell script. This feature is useful for repetitive tasks such as running execution plans, comparisons, or populating hosts.

The interactive command-line mode uses the Jython interpreter as its shell. When operating in this mode, the CLI offers you these advantages:

ProcedureHow to Run the Single-Command CLI

Step

    From a server where the CLI Client is installed, type the command.


    ./cr_cli -cmd subsystem.object.command -u user -p password
    

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.