Data Set

 

For each Command Set, there will be an associated Data Set, which contains all the data definitions needed for the corresponding commands. These data definitions are in the form of an XML with file extension dat.

 

The Data Set contains instances of the commands in the Command Set.

 

The table given below is a list of parameters grouped under the DATA-SET tag, with a brief description.

 

Tag Description

STR-DATA-SET

 

It includes a list of data values in a data set file.

CMDDATA

It includes a list of commands in a command set file. It contains the NAME attribute for identifying the command in the command set to which the data belongs.

DATA

It has a list of data instances for a particular command.

OBJECT

It is similar to that in the Command Set except that it represents the value (data) for the object. It has a NAME attribute to identify the object.

PARAM

It contains all the values of the parameters in the command. It has the following attributes:

  1. NAME: for the name of the parameter.

  2. VALUE: indicates that it contains only the value.

OPTIONS

It denotes the various options that command can append. It contains the following elements :

  1. SIMPLE_OPTS: simple option without arguments.

  2. SIMPLE_OPT_ARGS: simple option with arguments.

  3. LONG_OPTS: long option without arguments.

  4. LONG_OPT_ARGS: long option with arguments.

 

The following examples illustrate the usage of forming a Data Set corresponding to a Command Set.

  1. Listing a directory in UNIX operating systems.

  2. Show Command to get the details of Cisco devices.

Example 1: Listing a directory in UNIX operating systems.

 

<CMDDATA CMDNAME="ls">

<DATA NAME="ls">

<OPTIONS>

<SIMPLE_OPTS OPT_VAL="l" />

<SIMPLE_OPTS OPT_VAL="a" />

<SIMPLE_OPTS OPT_VAL="d" />

<SIMPLE_OPTS OPT_VAL="f" />

<LONG_OPT_ARGS OPT_NAME="time" OPT_ARG="=status" />

</OPTIONS>

</DATA>

</CMDDATA>

 

The above example command template is defined for listing directories on UNIX systems. It contains the actual command name ls with different simple options that have to be sent to the device. The above data instance is for the command ls in UNIX systems. With the long listing format, it can be noticed that the above definition contains only data for the previously defined command template and it is almost similar to the command template.

 

Please refer to unixcmds.dat file available in <CLI Home>/conf directory for complete details.

 

Example 2: Show command to get the details of Cisco devices.

 

<CMDDATA CMDNAME="show">

<DATA NAME="dataname">

<OBJECT NAME="ip" VALUE="ip">

<OBJECT NAME="access-list" VALUE="access-list">

<OBJECT NAME="compiled" VALUE="compiled"/>

<PARAM NAME="access-list-number" VALUE="101"/>

<PARAM NAME="name" VALUE="name"/>

</OBJECT>

</OBJECT>

</DATA>

</CMDDATA>

 

The above example command template is defined to send the actual show commands to devices to display detailed system and protocol information of Cisco devices. The command consists of an object, which has parameters that have to be sent to the device.

 

Please refer to showcmds.dat file available in <CLI Home>/conf directory for complete details.

 

Related Topics



Copyright © 2009 ZOHO Corp. All Rights Reserved.