Use this when staging NETCONF changes in candidate.
candidate
The candidate datastore holds staged configuration changes that do not affect the device until a commit copies them to running, letting several edits be applied together or discarded.
1. candidate stages changes; commit applies atomically.
2. validate before commit.
3. discard-changes on failure.
4. Confirmed commit (:confirmed-commit) auto-rolls back if not confirmed.
5. Lock candidate.
edit candidate → validate → commit (confirmed) → confirm
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as capability mismatch, namespace drift, wrong datastore, lock contention, partial edit semantics and assuming <ok/> shows final device behavior, choosing the cases most relevant to candidate datastore capability, staged edits, validation/commit/discard and lock ownership before changes reach running.
Step 2 Common mistakes Narrow the fault
- Assuming every device supports candidate (check capabilities).
- Forgetting the final commit.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Candidate holds staged changes.
- Nothing applies until commit.
- discard-changes drops staged edits.
- :candidate capability — support
- edit-config target=candidate → validate → commit — transaction
- discard-changes on failure — cleanup
ReferenceWhy it matters1 section · depth on demand
What it is
The candidate datastore holds changes that are not active until <commit>; <discard-changes> drops them. With confirmed commit, the device rolls back automatically unless confirmed.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
The candidate datastore holds a working copy of the configuration where changes can be prepared without affecting the device. Only a <commit> makes them active, and a <discard-changes> throws them away. This gives NETCONF transactional behaviour: all of a change goes live together.
Workflow:
1. <lock> candidate (and running).
2. <edit-config> on candidate, possibly several times.
3. <validate> candidate.
4. <commit> — optionally <confirmed/> with a timeout.
5. <unlock>.
with m.locked("candidate"):
m.edit_config(target="candidate", config=cfg)
m.validate(source="candidate")
m.commit(confirmed=True, timeout="120")
# verify reachability, then
m.commit()
Mechanics
Its durable intent is capability-aware XML RPC intent against explicit running/candidate/startup datastores; the stable identity contract is device, session/RPC message-id, datastore, YANG module/revision and target path.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in NETCONF > candidate. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc6241 · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For candidate datastore capability, staged edits, validation/commit/discard and lock ownership before changes reach running, prefer typed fields and stable IDs over human presentation text.