A government agency script runs inside the Nexus on-box Python interpreter and must execute a show command on that same switch. Which interface is built for that call?
Select an answer to reveal the explanation.
Short Explanation
The on-box interpreter already has a telephone on the desk. You import the cli module and run the show command inside that interpreter, which is the supported on-box call. Ansible and Terraform are outside tools and are not modules of this interpreter.
Full Explanation
The NX-OS on-box Python interpreter includes a cli module whose calls run CLI on the same switch and return the result to the script. That is the interface the agency script should use for a show command while it is executing on the switch. The module is part of that interpreter, not a package the operator invents. Ansible uses an inventory and modules from a control host over SSH. The on-box interpreter does not become an Ansible runner because a script imported a file, and an inventory is not how this interpreter sends CLI. Terraform compares a desired state with a provider and applies a plan from an external host. A state file on bootflash is not executed by the on-box Python interpreter when it is imported. SPAN copies frames. It does not invoke show commands or return their text to a Python script. Caveat: the cli module runs with the privileges of the execution context, so a show command can still be denied if that context is not allowed to run it. Operational check: from the on-box interpreter, import the cli module, run the show command, and confirm the returned text matches the same command from an allowed session.