[Contents] [Prev] [Next] [Index] [Report an Error]

# Mapping Commands to SRC XML Tag Elements

The SRC XML API defines tag-element equivalents for many commands in CLI operational mode. For example, the <get-interfaces> tag element corresponds to the show interfaces command.

For information about the available command equivalents in the current release of the SRC software, see the SRC XML API Operational Reference. For the mapping between commands and XML tag elements, see the table at the beginning of each chapter. For detailed information about a specific operation, see the appropriate section for the request tag element.

The following sections describe the tag elements that map to command options:

- Mapping for Command Options with Variable Values
- Mapping for Fixed-Form Command Options

## Mapping for Command Options with Variable Values

Many CLI commands have options that identify the object that the command affects or reports about, distinguishing the object from other objects of the same type. In some cases, the CLI does not precede the identifier with a fixed-form keyword, but XML convention requires that the SRC XML API define a tag element for every option. To learn the names for each identifier (and any other child tag elements) for an operational request tag element, consult the tag element’s entry in the appropriate DTD or in the SRC XML API Operational Reference.

The following example shows the XML tag elements for a CLI operational command that has variable-form options. In the show interfaces command, eth0 is the name of the interface.

CLI Command | SRC XML Tags
--- | ---
show interfaces eth0 | <rpc> <get-interfaces> <interface-name>eth0</interface-name> </get-interfaces> </rpc>

## Mapping for Fixed-Form Command Options

Some CLI commands include options that have a fixed form, such as the brief and detail strings, which specify the amount of detail to include in the output. The SRC XML API usually maps such an option to an empty tag whose name matches the option name.

The following example shows the XML tag elements for the show disk status command, which has a fixed-form option called brief.

CLI Command | SRC XML Tags
--- | ---
show disk status brief | <rpc> <get-disk-status> <brief/> </get-disk-status> </rpc>

[Contents] [Prev] [Next] [Index] [Report an Error]