nerdexam
Cisco

300-435 · Question #127

Drag and drop the code from the bottom onto the box where the code is missing to construct an ncclient request that captures the operational IPv4 routing data for a Cisco IOS XE device. Not all…

This question tests the ability to construct a Python ncclient NETCONF request that retrieves operational (live state) IPv4 routing table data from a Cisco IOS XE device, using the correct NETCONF RPC operation and a properly namespaced XML subtree filter.

Device-Level Network Automation

Question

Drag and drop the code from the bottom onto the box where the code is missing to construct an ncclient request that captures the operational IPv4 routing data for a Cisco IOS XE device. Not all options are used.

Explanation

This question tests the ability to construct a Python ncclient NETCONF request that retrieves operational (live state) IPv4 routing table data from a Cisco IOS XE device, using the correct NETCONF RPC operation and a properly namespaced XML subtree filter.

Approach. Because IPv4 routing table entries are operational state data (not configuration), the correct ncclient method is m.get(), NOT m.get_config(). A subtree filter must be constructed as an XML string targeting the appropriate YANG model - typically Cisco-IOS-XE-ip-oper (namespace: http://cisco.com/ns/yang/Cisco-IOS-XE-ip-oper) or the IETF ietf-routing model with routing-state as the root element. The filter is passed to m.get(filter) and the result contains the live routing table in XML format. Key code elements to place in order are: (1) the manager.connect() block with device credentials, (2) an XML filter string scoped to IPv4 route operational data, and (3) the m.get(filter) call - not m.get_config(), which only retrieves candidate/running/startup configuration.

Concept tested. NETCONF/ncclient: distinguishing get (operational state) vs get-config (configuration data), constructing XML subtree filters with correct YANG model namespaces, and using the ncclient Python library to programmatically retrieve live IPv4 routing data from Cisco IOS XE devices.

Reference. Cisco DevNet DEVASC 200-901 / ENAUTO 300-435 - NETCONF and YANG; ncclient documentation; Cisco-IOS-XE-ip-oper YANG model

Topics

#ncclient#NETCONF#YANG#Operational Data

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice