Question 32 of 60 from exam 300-435-ENAUTO: Automating and Programming Cisco Enterprise Solutions

Question 32 of 60 from exam 300-435-ENAUTO: Automating and Programming Cisco Enterprise Solutions

Question

from device info import ios_xel
from ncclient import manager
import xmltodict

netconf_filter = open(‘filter-ietf-interfaces.xml”) .read()

if name == ‘_main /:
with manager. connect (host=ios_xel[“address”] ,
port=ios+xel[“port”],
username=ios+xel [“username”] ,
password=ios+xel ["password’’] ,
hostkey_verify=False) as m:

netconf_reply = m.get(netcong_filter)

intf£_details = xmltodict.parse(netconf_reply.xml) [“rpe-reply”] ["data”]
intf_config = intf_details[“interfaces”] [“interface”]
intf_info = intf_details[“interfaces-state”] [“interface”]

print (™”)
print (“Interface Details:”)

print(“ Name: {}”.format ( ['name”]))

print(* Description: {}”.format (intf£_config["description”]))

print (" Type: {}”. format (intf£_config[“type”] [“#text”]))

print (" MAC Address: {}”. format (intf£_info[“phys-address”]))

print(" Packet Input: {}”.format(intf_info["statistics”] [‘in-unicast-pkts”]))
print(" Packet Output: {}”.format(intf_info[“statistics”] [Yout-unicast-pkts”]) )
<filter>
<interfaces xmlns="urn:ietf:params:xml:ns:yang: ietf-interfaces”>
<interface>
<name>GigabitEthernet2</name>
</interface>
</interfaces>

<interfaces-state xmlns="urn: ietf:params:xml:ns:yang: ietf-interfaces”>
<interface>
<name>GigabitEthernet2</name>
</interface>
</interfaces-state>
</filter>

Refer to the exhibits.

An engineer creates a Python scripts using ncclient to display interface information.

The code must be completed so that it can be tested.

Which expression completes the highlighted section in the format call?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

The highlighted format cell for print is for the host.

https://github.com/CiscoDevNet/dnac-python-path-trace/blob/master/path_trace.py