300-435 Question 75
Select 3You are tasked with managing a Cisco network device using NETCONF. You need to write a Python script with ncclient to retrieve the device's running configuration. Which of the following steps are essential to accomplish this task?
- A
Establish a NETCONF session to the device using ncclient's manager.connect() function
- B
Use the manager.get_config() method with the source parameter set to 'running'
- C
Send a RESTCONF GET request to retrieve the running configuration
- D
Import the ncclient.manager module before writing the script
- E
Use the manager.edit_config() method to fetch the running configuration
Show answer and explanation
Correct answers: A, B, D
Explanation
To manage a Cisco device using NETCONF with ncclient, you need to follow specific steps such as establishing a session using manager.connect(), importing the necessary ncclient.manager module, and using the appropriate method like manager.get_config() to retrieve the running configuration. RESTCONF and edit_config are unrelated or incorrect for this task.
- A. Correct.
Correct. Establishing a NETCONF session using ncclient.manager.connect() is a fundamental step to interact with the NETCONF-enabled device.
- B. Correct.
Correct. The manager.get_config() method with the source set to 'running' is the correct approach to retrieve the running configuration.
- C. Incorrect.
Incorrect. RESTCONF is a different protocol and is not relevant when using ncclient for NETCONF operations.
- D. Correct.
Correct. Importing the ncclient.manager module is required to access the necessary functions provided by ncclient.
- E. Incorrect.
Incorrect. The manager.edit_config() method is used to modify the configuration, not to fetch the running configuration.