nerdexam
Cisco

200-901 · Question #669

Drag and Drop Question Drag and drop the code from the bottom onto the box where the code is missing to present GigabitEthernet2 details in the XML format. Not all options are used. Answer:

The correct answer is get_config; running; name="2". The question requires filling in blanks in a Python script to retrieve the configuration details of GigabitEthernet2 from a network device using NETCONF, specifically targeting the running configuration via an XPath filter.

Cisco Platforms and Development

Question

Drag and Drop Question Drag and drop the code from the bottom onto the box where the code is missing to present GigabitEthernet2 details in the XML format. Not all options are used. Answer:

Exhibit

200-901 question #669 exhibit

Answer Area

Drag items

runningcurrentname="2"2get_configput_configcommit

Correct arrangement

  • get_config
  • running
  • name="2"

Explanation

The question requires filling in blanks in a Python script to retrieve the configuration details of GigabitEthernet2 from a network device using NETCONF, specifically targeting the running configuration via an XPath filter.

Approach. The goal is to retrieve configuration data for a specific interface.

  1. First blank (m. ______ (): The script intends to get configuration details. Among the available options, get_config is the correct ncclient method for this purpose. put_config (or more commonly edit_config) would be for modifying configuration, and commit is for applying pending changes.

  2. Second blank (' ______ ' , ): This argument specifies the NETCONF datastore from which the configuration should be retrieved. running is a standard NETCONF datastore representing the active configuration on the device. current is not a standard NETCONF datastore name. Therefore, running is the correct choice.

  3. Third blank (GigabitEthernet[ ______ ]): This is part of an XPath expression used to filter for a specific interface. To target 'GigabitEthernet2', assuming the interface number '2' is held in a 'name' attribute within the XML structure (a common practice for interface identification in NETCONF), the correct XPath filter would be [name="2"]. Just using [2] would select the second child element, which is not what's intended for filtering by interface number.

Common mistakes.

  • common_mistake. 1. Using put_config or commit instead of get_config: These operations are for modifying or applying configuration changes, not for retrieving existing configuration. The question specifically asks to 'present' details, implying retrieval.
  1. Using current instead of running for the datastore: current is not a recognized NETCONF datastore. The running datastore holds the active configuration of the device.
  2. Using 2 instead of name="2" for the XPath filter: XPath filters for specific elements often use attribute-value pairs, like [attribute="value"]. Simply using [2] without an attribute name would typically select the second child element, not an element where an attribute's value is '2'. The prompt specifies 'GigabitEthernet2', which implies filtering by an identifier attribute like 'name'.

Concept tested. This question tests the understanding of NETCONF protocol operations (specifically get-config), NETCONF datastores (running), and how to construct XPath filters for querying specific data within an XML configuration tree. It also assesses familiarity with the Python ncclient library for interacting with NETCONF-enabled devices.

Topics

#XML#Network Programmability#Cisco IOS XE#Structured Data

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice