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

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

Question

DRAG DROP -

$ pyang -£ tree ietf-interfaces.yang
module: ietf-interfaces
+--rw interfaces
+--rw interface* [name]
name string

I

I

I description? string

I type identityref
I enabled? boolean
I
I
I
I

statistics
xo discontinuity-time  yang:date-and-time
xo in-unicast-pkts? yang: counter64
+--ro in-broadcast-pkts? yang: counter6é4
interfaces-state
interface* [name]
name string
type identityref
admin-status enumeration {if-mib}?
oper-status enumeration
statistics
xo discontinuity-time  yang:date-and-time
xo in-octets? yang: counter64

xo in-unicast-pkts? yang: counter64

Refer to the exhibit.

Drag and drop the code from the bottom onto the box where the code is missing to complete the ncclient request that captures the operational data of the interfaces of a Cisco IOS XE device.

Options may be used once, more than once, or not at all.

Select and Place:

from neclient import manager
import xml.dom.minidom

USERNAME = ‘cisco’
PASSWORD = ‘cisco’
HOST = '10.10.20.161"

data ="

< evf-interfaces”>

<statistics></statistics>

>

with manager.connect (host=HOST, password=PASSWORD, port ISERNAME,
hostkey_verify-False, device _params=(‘name’:/iosxe’}) as m:

© = m.get (filter=(" , data) .date_xml

xml = xml .dom.minidom.parseString(c)
xml_pretty_str = xml.toprettyxm! ()
print (xml_pretty_str)

interfaces-state interface-state interfaces

xpath subtree interface

Explanations

from neclient import manager
import xml.dom.minidom

USERNAME = ‘cisco’
PASSWORD = ‘cisco’
HOST = '10.10.20.161"

data ="

< [interrace-state evf-interfaces”>

< [xpath

<statistics></statistics>

</ [interface >

interface-state

with manager.connect (host=HOST, password=PASSWORD, port ISERNAME,
hostkey_verify-False, device _params=(‘name’:/iosxe’}) as m:

¢ = m.get (filter=("|subtree ™, data) .data_xml

xml = xml .dom.minidom.parseString(c)
xml_pretty_str = xml.toprettyxm! ()
print (xml_pretty_str)

interfaces-state interface-state interfaces

xpath subtree interface