300-610 practice question 5 of 35

A Cisco engineer is developing a custom application that can run natively in Cisco NX-OS on Nexus 9000 and Nexus 3000 platforms For the NX-SDK…

Full set: 277 questions
A Cisco engineer is developing a custom application that can run natively in Cisco NX-OS on Nexus 9000 and Nexus 3000 platforms For the NX-SDK application to run the engineer enables the NX-SDK feature on the device Then the NX-SDK is imported into the application via an import nx_sdk_py statement. The engineer creates custom CLI commands and defines custom CLI command syntax within the sdkThread function When CLI commands originate from an NX-SDK application what class is this?
Answer options
A: clicm.printConsole
B: postCliCb
C: pyCmdhandler Correct answer
D: nx_sdk_pyValid-to_int
Correct Answer:
C. pyCmdhandler
Explanation

The Cisco NX-SDK allows developers to create custom applications that run natively on NX-OS. When creating custom CLI commands for these applications, the developer must define a command handler class. This class inherits from the nxsdkpy.CmdHandler base class. The pyCmdhandler is the specific class instance within the application's code that is responsible for parsing the custom CLI command, executing the associated logic, and returning output to the console. It is the entry point for CLI interactions originating from an NX-SDK application.

Why Incorrect

A. clicmd.printConsole: This is a method used within a command handler to print output to the user's console, not the class that handles the command itself.
B. postCliCb: This refers to a post-CLI callback, a function that is executed after a CLI command has been processed, typically for logging or verification, not for handling the command's primary execution.
D. nxsdkpy.Validtoint: This is a utility function provided by the NX-SDK library to safely convert a value to an integer, not a class for handling CLI commands.

References

1. Cisco, "Cisco Nexus 9000 Series NX-OS Programmability Guide, Release 10.2(x)". In the chapter "Cisco NX-SDK," the section "Creating a Custom CLI Command" provides example code showing the definition of a command handler class: class pyCmdHandler(nxsdkpy.CmdHandler):. This demonstrates pyCmdHandler is the user-defined class for this purpose.

2. Cisco DevNet, "NX-SDK Tutorial". The tutorial's sample code for creating a CLI command consistently shows the implementation of a pyCmdHandler class that inherits from nxsdkpy.CmdHandler to process CLI input.

Scroll to Top