A logistics company wants a Python script that runs inside the NX-OS Python interpreter and executes CLI on that same switch. Which facility is built for those CLI calls?
Select an answer to reveal the explanation.
Short Explanation
The person you need is already in the building and knows the house phone system. You call CLI through the cli module in the on-box Python interpreter so the script runs on the switch and reads the output there. An off-box API client is a different path, and it is not the facility inside that interpreter.
Full Explanation
NX-OS includes a Python interpreter on the switch, and the cli module is how a script in that interpreter executes CLI and collects the output without leaving the box. That is the facility this logistics script should use. An off-box NX-API client can send the same style of command over the network, and it is not code running inside the on-box interpreter. The interpreter is not blocked from local commands. Terraform is an external declarative tool with its own provider and state. The on-box interpreter does not import a Terraform provider in order to run a show command. POAP is the day-0 process that brings up a switch with no startup configuration. The Python interpreter and the cli module are available on a switch that is already in service, not only during bootstrap. Caveat: the script still runs with the privileges of the user who invoked it, so a read-only role cannot use the module to enter configuration. Operational check: run a short script in the on-box interpreter that calls the cli module for one show command, and confirm the output matches the same command typed at the switch prompt.