300-435 · Question #48
Refer to the exhibit. What is the correct ncclient method to use to collect the running configuration of a Cisco IOS XE device that uses NETCONF?
The correct answer is D. config=m.get_config(source='running'). The ncclient method to collect the running configuration from a NETCONF-enabled Cisco IOS XE device is m.get_config(source='running'), which directly maps to the NETCONF <get-config> operation.
Question
Options
- Aconfig=m.copy_config(source='running')
- Bconfig=m.get(source='running')
- Cconfig=m.collect_config(source='running')
- Dconfig=m.get_config(source='running')
How the community answered
(22 responses)- A9% (2)
- B5% (1)
- D86% (19)
Why each option
The `ncclient` method to collect the running configuration from a NETCONF-enabled Cisco IOS XE device is `m.get_config(source='running')`, which directly maps to the NETCONF `<get-config>` operation.
The `copy_config()` method is used to copy configuration between datastores (e.g., running to startup), not to retrieve configuration for display or processing.
The `get()` method is used to retrieve operational data (state information) and optionally configuration, but `get_config()` is specifically for configuration data and is more precise when only configuration is needed.
`collect_config()` is not a standard or recognized method within the `ncclient` library for retrieving configuration data.
The `ncclient` library's `get_config()` method directly implements the NETCONF `<get-config>` operation, which is the standard mechanism to retrieve configuration data from a device, and the `source='running'` argument specifies the running configuration datastore.
Concept tested: ncclient NETCONF get-config operation
Source: https://ncclient.readthedocs.io/en/latest/api.html#ncclient.manager.Manager.get_config
Topics
Community Discussion
No community discussion yet for this question.