200-901 Practice Question: A network engineer is using Cisco IOS XE RESTCONF to retrieve the hostname of a device
A network engineer is using Cisco IOS XE RESTCONF to retrieve the hostname of a device. The device has already enabled netconf-yang and restconf. Which URL path should be used?
⚠ Common exam trap
Many exam-takers confuse RESTCONF resource types (data vs. config vs. operations) and forgetting the mandatory YANG module prefix and container hierarchy, which leads candidates to choose simplified but invalid paths like /restconf/data/hostname.
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
✓
/restconf/data/Cisco-IOS-XE-native:native/hostname
The correct URL path for retrieving configuration data via RESTCONF is /restconf/data/{module-name}:{container-path}. In Cisco IOS XE, the hostname is modeled under the Cisco-IOS-XE-native module within the 'native' container, so the full path is /restconf/data/Cisco-IOS-XE-native:native/hostname. This follows RFC 8040, which defines the 'data' resource for accessing configuration and state data, and requires the module name prefix when the node is not in the default namespace.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
/restconf/data/hostname
Why it's wrong here
RESTCONF data paths must start with the module that defines the data, written as 'module:node'. '/restconf/data/hostname' gives no module, so the device cannot tell which YANG model is meant and returns an error, typically 400 or 404. On IOS XE, the hostname lives in the Cisco-IOS-XE-native module under the 'native' container, giving the path in option B.
- ✓
/restconf/data/Cisco-IOS-XE-native:native/hostname
Why this is correct
RESTCONF paths follow the YANG model: after '/restconf/data', the first node is prefixed with its module name, and deeper nodes are separated by slashes. The hostname is a leaf in the 'native' container of Cisco-IOS-XE-native, so a GET to this path with 'Accept: application/yang-data+json' returns something like {"Cisco-IOS-XE-native:hostname": "R1"}, and a PATCH to it changes the hostname.
- ✗
/restconf/operations/hostname
Why it's wrong here
'/restconf/operations' is where RPCs, actions that are not data, are invoked with POST, for example saving the configuration through Cisco's save-config operation. Reading a value is a GET on a data resource under '/restconf/data'. Using the operations root for data retrieval would fail because no RPC named hostname exists. Data always lives under the data resource.
- ✗
/restconf/config/Cisco-IOS-XE-native:native/hostname
Why it's wrong here
'/restconf/config' comes from early RESTCONF drafts and is not part of the standard, RFC 8040, which uses '/restconf/data' for both configuration and state data. Current IOS XE devices therefore reject or do not recognise this path. The correct, standard path is '/restconf/data/Cisco-IOS-XE-native:native/hostname', and the 'content' query parameter can filter config or non-config data if needed.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 200-901 question from scratch — 975 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 →
You might also like
Similar 200-901 questions
- When using the NX-API on Cisco NX-OS, which HTTP method is used to send CLI commands in JSON format?
- Which NX-OS API method allows sending CLI commands in JSON format without enabling any additional features?
- A network automation engineer is evaluating options for model-driven programmability on Cisco devices. Which THREE are v…
- A developer wants to create a Webex webhook that triggers when a new message is posted in any room the bot is in. Which…
- Which EEM applet action is used to execute a CLI command when an event triggers?
Written and reviewed by Johnson Ajibi, MSc IT Security
Security Systems Architect · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
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.