N1 Service Provisioning System 4.1 User's Guide

The Command Line Interface (CLI)

The command-line interface (CLI) is a suite of tools for accessing the provisioning software through non-HTML interfaces, such as a Windows prompt, a shell, or a script. CLI commands can be used in scripts to automate operations, such as checking in files. They can also be used to access the Master Server from systems that lack a Web browser or an HTTP connection.

The CLI is a Command-Line Interface Client which can be installed on any computer that can make a network connection to the Master Server. The client parses the commands into native objects and sends them to the Master Server. Results of the commands are then translated by the client to a textual format and presented to users.

Most CLI commands require authentication. Users authenticate themselves by specifying a user name and a password or a session ID with each command. See Authentication by Username and Password or Session ID in N1 Service Provisioning System 4.1 Reference Guide for more information.

There are two tools for invoking the CLI:

cr_cli: Single-Line Command Mode

The single-line command mode accepts one command at a time as input. Each command submitted must be complete; the user is not interactively prompted for the next input parameter. Operating in this mode, the Command-Line Interface Client does not maintain a command history.

Here is an example of a CLI command executed with the cr_cli tool. This command adds a host of type prodserver to the host database. The user running this command, rbarnes, supplies his password to authenticate himself to the Master Server.


cr_cli –cmd hdb.h.add -u barnes -p bar123 -name webb1  -desc `web server 1' –tID prodserver  

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

cr_clij: Interactive Command Mode

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

The Structure of CLI Commands

Whether invoked through cr_cli or cr_clij, all CLI commands use the following format:

subsystem.object.command arguments  

For example, the command for adding a host to the N1 Service Provisioning System software database is hdb.h.add. This command consists three elements that identify:

Table 1–4 lists the CLI prefix for each N1 Service Provisioning System software subsystem, along with the chapters in this guide that discuss the subsystem.

Table 1–4 N1 Service Provisioning System Software Subsystems and Their CLI Prefixes

Subsystem 

CLI Prefix 

Chapters 

Component database 

cdb 

See Chapter 6, cdb: CLI Commands for Managing Components in N1 Service Provisioning System 4.1 Reference Guide

Configuration generator 

cfg 

See Chapter 7, cfg: CLI Commands for Performing Config-Generation in N1 Service Provisioning System 4.1 Reference Guide

Comparison Engine 

cmp 

See Chapter 8, cmp: CLI Commands for Running Comparisons in N1 Service Provisioning System 4.1 Reference Guide

Host Database 

hdb 

See Chapter 9, hdb: CLI Commands for Managing Hosts in N1 Service Provisioning System 4.1 Reference Guide

Network Operations 

net 

See Chapter 10, net: CLI Commands for Performing Network Operations in N1 Service Provisioning System 4.1 Reference Guide

Plan Database 

pdb 

See Chapter 11, pdb: CLI Commands for Managing Plans in N1 Service Provisioning System 4.1 Reference Guide

Plan Execution 

pe 

See Chapter 12, pe: CLI Commands for Running Plans in N1 Service Provisioning System 4.1 Reference Guide

Resources 

cdb.rsrc 

See Chapter 13, CLI Commands for Managing Resources in N1 Service Provisioning System 4.1 Reference Guide

Rules for Notifications 

rule 

See Chapter 14, rule: CLI Commands for Notifications in N1 Service Provisioning System 4.1 Reference Guide

User Database  

udb 

See Chapter 15, udb: CLI Commands for Managing Users and Groups in N1 Service Provisioning System 4.1 Reference Guide

Categories 

cat 

See Chapter 16, Configuration Generation in N1 Service Provisioning System 4.1 Reference Guide


Note –

This user manual does not contain a complete list of CLI commands. Each section does list the more frequently used CLI commands that relate to the specific topic. For a complete list of CLI commands, please see N1 Service Provisioning System 4.1 Reference Guide.