QuestionQ66

Automation

Question Image

An engineer needs to use the Python module in the guest shell of a Cisco Nexus 9000 Series switch to shut down port Ethernet 1/4. Which command set accomplishes this?

  • A from cli import * cli(''conf t'') cli(''interface eth1/4'') cli(''shutdown'')
  • B from cisco import cli cli(''conf t'' ; ''interface eth1/4'' ; ''shutג€)
  • C from cli import * cli(''conf t ; interface eth1/4 ; shut'')
  • D from cisco import cli cli(''conf t ; interface eth1/4") cli(''shutdown'')
Explanation

The NX-OS Python CLI API is imported with from cli import *. Configuration context is preserved only when the related CLI commands are combined in one cli() call, using space-surrounded semicolons; conf t ; interface eth1/4 ; shut enters configuration mode, selects Ethernet 1/4, and administratively shuts it down.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!