300-435 Question 77
Select 3You are tasked with creating a Python script using ncclient to retrieve the interface configuration of a Cisco device via NETCONF. Which of the following steps are necessary to accomplish this task?
- A
Establish a NETCONF session to the device using ncclient's manager.connect() method
- B
Use the get_config() method to retrieve the running configuration of the device
- C
Import the requests library to handle NETCONF communication with the device
- D
Specify the desired XML filter to retrieve only interface-related data
- E
Install the NETCONF agent on the Cisco device before executing the script
Show answer and explanation
Correct answers: A, B, D
Explanation
To retrieve the interface configuration of a Cisco device using ncclient, you need to establish a NETCONF session, use the get_config() method to query the running configuration, and apply an XML filter to limit the output to interface-related details. The requests library is not applicable for NETCONF, and Cisco devices come with a built-in NETCONF agent, so no additional installation is required.
- A. Correct.
Correct: Establishing a NETCONF session is a fundamental step to communicate with the device using ncclient.
- B. Correct.
Correct: The get_config() method is used in ncclient to retrieve configuration data, including the running configuration.
- C. Incorrect.
Incorrect: The requests library is not used for NETCONF communication. The ncclient library handles this functionality.
- D. Correct.
Correct: Specifying an XML filter is required to limit the data returned to only the interface-related information.
- E. Incorrect.
Incorrect: Cisco devices already have a built-in NETCONF agent. There is no need to install a separate NETCONF agent.