Using the CLI

The yp-shell program can be used within the server to provide a YANG-aware command line interface. It is based on the 'yangcli-pro' program, and provides limited functionality for a dedicated session to the local NETCONF server.

The program connects to the local server as a NETCONF client. Command lines are converted to NETCONF RPC operations as needed and the server responses are used and/or displayed to complete high level network management functions.

yp-shell Setup

The yp-shell program must be installed and setup on the target system before it can be used.

Binary Packages

The yp-shell program must be setup as a shell on the target system. This program is included in the 'Advanced' feature binary packages:

  • yumapro-sdk

  • yumapro-pthreads

  • yumapro-sdk-eval

  • yumapro-pthreads-eval

Source Packages

This program is included in some source packages.

  • yumapro

  • yumapro-server

The WITH_CLI=1 make option must be used to include this feature in the build.

Target System Setup

The login user for the CLI must be properly configured to the yp-shell program will function properly.

Documentation

The YumaPro yangcli-pro Manual contains the documentation for the yp-shell program. Only a subset of the CLI parameters and commands are allowed in yp-shell.

The following sections apply to yp-shell:

yp-shell Configuration

The yp-shell and yangcli-pro programs share the same configuration file.

Note

The default configuration file must be used for yp-shell if any CLI parameter settings are needed.

The file /etc/yumapro/yangcli-pro.conf will be checked when the yp-shell program is launched as a login shell. If it is not found, then only default CLI parameter settings will be used. However, most of the parameters can be changed at run-time using Read-write System Variables.

It is possible to specify the --run-script parameter in the configuration to run a yangcli script. This can be done to set variables and/or run commands at the start of each yp-shell session.

Controlling Available Commands

The commands available in a yp-shell session are a subset of all yangcli-pro commands.

  • Use the tab key at the exec mode prompt to display all available commands

Default Builtin Commands

By default, the following built-in commands are available in yp-shell:

In addition to these commands, the RPC operations learned from the server session are also listed as commands. An asterisk '*' follows the command name to indicate it is a server command.

Removing Commands

There are some parameters that can be used to control the commands that are visible and available to the user.

Adding Notification Commands

Use the --with-notif-commands='true' CLI parameter setting to enable the following commands:

Adding Scripts and Exec Commands

Use the --ypshell-exec-ok='true' CLI parameter setting to enable the run, run-shell, and related commands. The --allow-shell='true' CLI parameter setting must also be used.

yp-shell Differences

The yp-shell and yangcli-pro programs share the same code, but some behavior is different.

No Startup Screen

The yp-shell program uses a dedicated session to the local server. There is no startup screen that shows copyright and help info.

No Session Startup Screen

A summary of the server session modules, features, and other capabilities is shown when a yangcli-pro session starts. This is not done in yp-shell. This information can be displayed at any time using the 'show session' command.