350-401 Automation Practice Question
A network engineer is designing a Python script that uses the YANG models supported by a Cisco IOS XE device to configure interface descriptions via RESTCONF. The engineer wants to ensure the script uses the correct data model and avoids errors. Which TWO actions should the engineer take? (Choose two.)
⚠ Common exam trap
The trap here is assuming that all YANG modules are universally available or that the native model is always the correct choice, without verifying support and revision compatibility.
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
✓
Verify the YANG module revision date to ensure compatibility with the IOS XE version running on the device.
To configure interfaces via RESTCONF using YANG models, the engineer must first discover which YANG modules are supported by the device. The ietf-yang-library provides this information, including module names, revisions, and features. Checking the revision date ensures the script uses the correct version for the device's software. These two actions prevent schema errors and ensure successful configuration.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Verify the YANG module revision date to ensure compatibility with the IOS XE version running on the device.
Why this is correct
YANG modules are versioned with revision dates. A module revision may change between IOS XE releases, and using an outdated or mismatched revision can cause errors. By checking the revision date from the yang-library, the engineer can ensure the script uses the correct model version for the device's software, preventing schema mismatches.
- ✗
Use the 'Content-Type: application/yang-data+xml' header for all RESTCONF requests to ensure compatibility with YANG models.
Why it's wrong here
RESTCONF supports both JSON and XML, but the choice depends on the client's capability and preference. Using XML does not inherently ensure compatibility with YANG models; the models are independent of the encoding. The engineer should use the appropriate media type, often JSON for simplicity, and ensure the Accept and Content-Type headers match the chosen format.
- ✗
Use the Cisco IOS XE native YANG model 'Cisco-IOS-XE-native' for interface configuration, as it is always available and supports all features.
Why it's wrong here
While the Cisco-IOS-XE-native model is available on IOS XE devices, it is not the only model and may not be the best choice for all scenarios. The IETF model 'ietf-interfaces' is standard and often preferred for basic interface configuration. Assuming the native model is always the right choice can lead to non-standard configurations and reduced portability.
- ✓
Retrieve the list of supported YANG modules using the RESTCONF API endpoint /restconf/data/ietf-yang-library:modules-state.
Why this is correct
The ietf-yang-library module provides information about which YANG modules are supported by the device. Querying /restconf/data/ietf-yang-library:modules-state returns the list of modules, their revisions, and features. This allows the engineer to verify that the required module for interface configuration is available and to use the correct namespace and revision in the script.
- ✗
Assume that all YANG modules are available on all IOS XE devices, so no verification is needed.
Why it's wrong here
Not all YANG modules are supported on all IOS XE devices or software versions. Feature availability depends on the platform and license. Assuming universal availability can lead to failed requests when a module is missing. The engineer should always verify module support using the yang-library before attempting configuration.
Go deeper
Related to this question
Learn chapter
SDN Controllers and Cisco ACI
Key term
REST API for Network Devices
A REST API for network devices is a set of rules that allows software applications to communicate with routers, switches, and firewalls using standard web methods like GET, POST, PUT, and DELETE over HTTP or HTTPS.
Key term
NETCONF Protocol
NETCONF is a network management protocol that uses a structured data format to configure, retrieve, and modify network devices in a standard, programmatic way.
About these practice questions
This 350-401 question is part of Courseiva's 1,923-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 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.