nerdexam
Cisco

300-610 · Question #221

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 feat

The correct answer is C. pyCmdHandler. When creating custom CLI commands within a Cisco NX-SDK application for Nexus platforms, the pyCmdHandler class is used to define and manage these commands.

Automation

Question

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?

Options

  • Aclicmd.printConsole()
  • BpostCliCb
  • CpyCmdHandler
  • Dnx_sdk_py.void_to_int

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    4% (1)
  • C
    93% (26)

Why each option

When creating custom CLI commands within a Cisco NX-SDK application for Nexus platforms, the `pyCmdHandler` class is used to define and manage these commands.

Aclicmd.printConsole()

clicmd.printConsole() is a function used for printing output to the console from a CLI command, not a class that defines command handling.

BpostCliCb

postCliCb is a callback function that might be invoked after a CLI command is executed, but it is not the class responsible for defining or handling the custom CLI commands themselves.

CpyCmdHandlerCorrect

In the Cisco NX-SDK for Python, the `pyCmdHandler` class is specifically designed to register and manage custom CLI commands within an NX-SDK application. When custom CLI commands are defined within the `sdkThread` function, an instance of `pyCmdHandler` is used to map these commands to their respective callback functions, allowing the application to respond to user input via the CLI.

Dnx_sdk_py.void_to_int

nx_sdk_py.void_to_int is a utility function for type conversion within the SDK, not related to defining custom CLI command handlers.

Concept tested: Cisco NX-SDK custom CLI commands

Source: https://developer.cisco.com/docs/nx-os-programmability/!/nx-sdk/get-started-with-nx-sdk-python-developer-guide

Topics

#NX-SDK#NX-OS programming#custom CLI#automation development

Community Discussion

No community discussion yet for this question.

Full 300-610 Practice