Courseiva
Automation →mediumMultiple Choice

CCNP Automation Practice Question

A network automation engineer is using the ncclient Python library to retrieve the running configuration from a Cisco IOS XE device via NETCONF. The engineer writes a script that establishes a NETCONF session and sends a <get-config> RPC. However, the script fails with an error indicating the source datastore is not specified. What should the engineer do to correct the script?

⚠ Common exam trap

The trap here is assuming that <get-config> works like <get> and does not need a source, or confusing the <target> element used in edit-config with the <source> element needed for get-config.

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

✓

Add a <source> element with <running/> inside the <get-config> RPC.

The <get-config> RPC in NETCONF requires a <source> element to identify the datastore (e.g., running, candidate, startup). Without it, the server cannot process the request. The correct fix is to include <source><running/></source> in the RPC. This is a common oversight when building NETCONF scripts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Add a <filter> element to specify the configuration subtree.

    Why it's wrong here

    A <filter> element is optional and used to limit the data returned, but it does not satisfy the requirement for a source datastore. The error specifically mentions missing source, so adding a filter without a source will not fix the problem. The source must be defined regardless of filtering.

  • ✗

    Change the RPC to <get> instead of <get-config>.

    Why it's wrong here

    <get> retrieves both configuration and state data, but it does not require a source datastore. However, the scenario specifically requires retrieving the running configuration, and <get> would return additional operational data. The error is about missing source, so switching to <get> does not address the root cause and may not be appropriate.

  • ✗

    Include a <target> element with <running/> in the RPC.

    Why it's wrong here

    <target> is used in edit-config operations to specify the datastore to modify, not in get-config. For get-config, the correct element is <source>. Using <target> would be invalid and likely cause a different error. The engineer must use <source> to indicate where to read from.

  • ✓

    Add a <source> element with <running/> inside the <get-config> RPC.

    Why this is correct

    The <get-config> RPC requires a <source> element to specify which datastore to retrieve configuration from. The running datastore is commonly used. Without it, the NETCONF server cannot determine which configuration to return, resulting in an error. Adding <source><running/></source> resolves the issue.

About these practice questions

Courseiva writes every 350-401 question from scratch — 1,923 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

This 350-401 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 350-401 exam.