200-901 Understanding and Using APIs Practice Question
A developer is using the ncclient library in Python to connect to a network device via NETCONF. Which operation should be used to modify the running configuration and commit the changes?
⚠ Common exam trap
Cisco often tests the distinction between candidate and running datastores, and the trap here is that candidates assume `edit_config()` alone commits changes, forgetting that a separate `commit()` is required when the device uses a candidate configuration model.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
edit_config() followed by commit()
In NETCONF, the `edit-config()` operation is used to modify the running configuration, and the `commit()` operation is required to make those changes permanent when the device operates in candidate configuration mode. The ncclient library provides these methods to align with the NETCONF protocol's standard operations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
validate() followed by get_config()
Why it's wrong here
validate() checks a candidate configuration against the device's schema, and get_config() only retrieves configuration; neither edits nor commits anything. It is tempting because validation is a genuine NETCONF step before committing, but it must be paired with edit_config and commit, not retrieval.
- ✗
get_config() followed by copy_config()
Why it's wrong here
get_config() retrieves configuration and copy_config() copies between datastores; neither modifies the running configuration with new values. It is tempting because copy_config() can move a candidate into running, which would be correct if the change already existed in another datastore rather than needing to be authored.
- ✓
edit_config() followed by commit()
Why this is correct
The NETCONF edit_config() operation writes changes into the candidate datastore, satisfying the requirement to modify configuration without immediately affecting the running state. commit() then promotes the candidate to running, which the stem explicitly demands. This two-step sequence matches the candidate-to-running workflow that NETCONF's distinct datastores enforce.
- ✗
discard_changes() followed by edit_config()
Why it's wrong here
discard_changes() reverts an uncommitted candidate configuration, so pairing it with edit_config() discards edits rather than committing them. It is tempting because both operations belong to the candidate-datastore workflow, but discard is the rollback action, the opposite of applying changes.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 975-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.