Generic CLI APi for System/Network Management Systems - Part 2

Posted on Monday, April 27, 2009 by Anuj Mehta

Proposed Solution

The solution to the above mentioned problem should:
1. Take care of internal details of command construction and parsing.
2. Decouple parsing code from the syntax of CLI command and command response. Any change in syntax should be dynamically reflected in parsing code.

The proposed Generic CLI API (Gen-CLI API) promises to offer a solution that takes care of the aforementioned requirements. It takes the template of command syntax and command response as input (Processing rules/template). These templates are sent as input to a parser generator. Based on these templates the parser generator generates code for constructing CLI command and for parsing command response. Thus whenever there is a change in the syntax of a CLI command or command response, the developer just needs to change the template file and feed them to parser generator which will generate the code on-the-fly. This approach avoids the painful activity of manual modification of parsing code whenever there is a change in format; making the management application system development and maintenance easier.

Step 1: The device management application sends a request to data processing layer for performing an action.

Step2: The decision engine forwards the request to command creator.

Step 3: Command creator contains the code for generating CLI command. After constructing CLI command it sends the command to the device communication layer.

Step 4: The device communication layer sends the CLI command for execution on the managed device.

Step 5: The managed device sends back the command response in raw form to the device communication layer.

Step 6: This raw command response is sent to response parser which contains the code for converting it into formatted output

Step 7: The formatted command response is then sent back to the data processing layer.

Step 8: Based on the command response the decision engine decides whether to send the response back to the presentation layer or forward it to command creator, latter is for handling the case where the command expects response from the user as part of executing a command.

1. The command syntax and output template or rules can be expressed in a standard format such as EBNF grammar Rules.

2. Parsing code can be easily changed as it is dynamically generated based on the template of command syntax and response.

1. This method requires that the Device CLI developer generates the template for the command and the response. This template will be the input for the Management application to process the command and parse response.

Related Posts
Part 1
Part 3

0 Responses to "Generic CLI APi for System/Network Management Systems - Part 2":