Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

get · NETCONF

Direct answer

get retrieves both configuration and operational state data, such as interface counters, optionally limited by a subtree or XPath filter.

When to use this

Use this when retrieving config and state with get.

First 30 seconds

1. get retrieves config and state data.

2. Always filter (large otherwise).

3. Subtree or XPath filters.

4. Namespaces in parsing.

5. Use for verification.

Operational verification

<get filter> → data (config + state)

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
NETCONF / YANG datastore automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformNETCONF / YANG datastore automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when retrieving config and state with get.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Effective-state and workload closure Verify boundary

Use stable request/job/target identifiers, independently read the target and effective state, then run the original workload and preserve rollback evidence. For asynchronous work, require terminal state plus target read-back.

Step 2 Verification path Verify boundary

Record device, session/RPC message-id, datastore, YANG module/revision and target path; inspect the runtime/control-plane result; then query the selected configuration or operational subtree on the network device through an independent read path and compare it with the versioned intent. 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 combined configuration/operational data retrieval, subtree/XPath filters when supported and interpreting returned datastore state without mutating it. Capture the exact run/request/message/task identity, versioned definition, selected target IDs and pre-state before mutation. If the operation is asynchronous, follow it to a terminal state and then query the owned target through a read path that does not depend on the write response.

Step 3 Common mistakes Narrow the fault
  • Using <get> without filters on large devices.
Step 4 Where it fails Narrow the fault

A failure at one layer must not be relabeled as another: authentication/authorization differs from target absence, parsing differs from policy/validation rejection, scheduling differs from execution, and controller success differs from consumer-visible convergence. Before retrying a mutating operation, read current target state using the stable identity device, session/RPC message-id, datastore, YANG module/revision and target path; if state is unknown, stop broad retries.

Evidence references

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.

observation · 1
Key points
  • get returns config and operational state.
  • Filters limit the output.
  • Use subtree or XPath filters.
Key checks
  • <get> with subtree/XPath filter — state + config
  • Filters to limit data — efficiency
  • Parse reply with namespaces — extraction
ReferenceWhy it matters1 section · depth on demand

Internals and state

Automation should be interpreted as a chain of independently observable states: request accepted, job/task succeeded, target object changed, effective runtime state confirmed and original workload verified. Automation evidence ladder: request accepted → job/task succeeded → target object changed → effective runtime state → original workload verified. Capture the identities that bind the path together—interface, namespace, process, VM, policy, session, target, device, route, principal or job as applicable—so observations from different layers refer to the same transaction.

ReferenceImportant terms & boundaries2 sections · depth on demand

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. The consumer-visible target is the selected configuration or operational subtree on the network device. Do not collapse parser/API acceptance, controller completion and target-evidence of the actual state into one green status. This matters because automation can return success while a later reconciler, worker, transport, target subsystem or consumer still fails.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

In depth

The NETCONF <get> operation retrieves both configuration and operational state from the device (the running view plus state data), optionally limited with a subtree or XPath filter. <get-config> returns configuration only.

flt = """<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"><interface><name>GigabitEthernet1</name></interface></interfaces-state>"""
reply = m.get(filter=("subtree", flt))
print(reply.data_xml)
OperationReturns
<get>Config + state
<get-config>Config from chosen datastore
<get-data> (NMDA, RFC 8526)Any datastore incl. operational

Always filter: an unfiltered <get> on a large device returns megabytes and can take a long time.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docNETCONF / YANG datastore automation current

Authoritative/upstream documentation reviewed for bounded claims in NETCONF > get. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc6241 · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Capture at minimum device, session, message-id, datastore, module/revision, target path, rpc-error/error-tag/error-path, commit result and read-back values. For collections or parallel work, retain per-item/per-target results so partial success remains visible. For combined configuration/operational data retrieval, subtree/XPath filters when supported and interpreting returned datastore state without mutating it, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?