CCNA AI and Network Operations Practice Question
Network Topology
Which option performs the RESTCONF operations correctly?
⚠ Common exam trap
Watch out for the required media type: RESTCONF uses application/yang-data+json, not generic application/json. Also, the YANG path must match the data model; for standard interface settings, use ietf-interfaces, not Cisco-IOS-XE-native. Finally, remember that a successful PATCH returns 204 No Content, not 200 OK.
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
✓
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0 with Accept: application/yang-data+json; then PATCH same URI with Content-Type: application/yang-data+json and body {"ietf-interfaces:interface":{"duplex":"full"}}; expect 204 No Content.
The correct base URI for RESTCONF is /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0. The Accept header must be application/yang-data+json. If the Content-Type header is incorrect (e.g., application/json), the router will return a 415 Unsupported Media Type error. Using the wrong YANG module path, such as Cisco-IOS-XE-native:interface/GigabitEthernet0/0, will result in a 404 Not Found because the data model does not match. After a successful GET, the PATCH request must include the same URI with Content-Type: application/yang-data+json and a JSON body specifying "duplex": "full". The response should be a 204 No Content if successful.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0 with Accept: application/yang-data+json; then PATCH same URI with Content-Type: application/yang-data+json and body {"ietf-interfaces:interface":{"duplex":"full"}}; expect 204 No Content.
Why this is correct
Ly uses the RESTCONF base URI /restconf/data/ with the ietf-interfaces YANG module path. The Accept header is set to application/yang-data+json, and the PATCH request uses the correct Content-Type and JSON body structure. A successful PATCH returns 204 No Content.
- ✗
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0 with Accept: application/json; then PATCH same URI with Content-Type: application/json and body {"duplex":"full"}; expect 204 No Content.
Why it's wrong here
This request fails because RESTCONF, defined in RFC 8040, requires the dedicated YANG media type application/yang-data+json for both the Accept and Content-Type headers. Sending application/json in the Content-Type header is an unsupported media type, causing the router to reject the PATCH with a 415 Unsupported Media Type error; likewise, an Accept header of application/json cannot be satisfied for a RESTCONF resource and would trigger a 406 Not Acceptable. Even if the media types were corrected, the PATCH body would still be invalid because the leaf 'duplex' must be wrapped in a module-qualified container (e.g., {"ietf-interfaces:interface":{"duplex":"full"}}), so this option is incorrect in multiple ways.
- ✗
GET /restconf/data/Cisco-IOS-XE-native:interface/GigabitEthernet0/0 with Accept: application/yang-data+json; then PATCH same URI with Content-Type: application/yang-data+json and body {"Cisco-IOS-XE-native:interface":{"duplex":"full"}}; expect 204 No Content.
Why it's wrong here
This is incorrect because the YANG path uses the Cisco-IOS-XE-native module, which is not the correct module for the duplex setting. The ietf-interfaces module should be used. Using the wrong module path will result in a 404 Not Found error.
- ✗
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0 with Accept: application/yang-data+json; then PATCH same URI with Content-Type: application/yang-data+json and body {"duplex":"full"}; expect 200 OK.
Why it's wrong here
This is incorrect because the JSON body for a PATCH request must include the YANG module prefix and the interface container, not just the leaf. Additionally, a successful PATCH returns 204 No Content, not 200 OK.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The 200-301 exam frequently reuses these exact scenarios with slightly different constraints.
✓GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0 with Accept: application/yang-data+json; then PATCH same URI with Content-Type: application/yang-data+json and body {"ietf-interfaces:interface":{"duplex":"full"}}; expect 204 No Content.Correct answer▾
Why this is correct
Ly uses the RESTCONF base URI /restconf/data/ with the ietf-interfaces YANG module path. The Accept header is set to application/yang-data+json, and the PATCH request uses the correct Content-Type and JSON body structure. A successful PATCH returns 204 No Content.
✗GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0 with Accept: application/json; then PATCH same URI with Content-Type: application/json and body {"duplex":"full"}; expect 204 No Content.Wrong answer — click to see why▾
Why this is wrong here
The specific factual error is that RESTCONF requires the media type application/yang-data+json for YANG data, not generic application/json.
Why candidates choose this
Candidates might think that application/json is acceptable because it is a common JSON media type, but RESTCONF mandates the specific yang-data+json subtype.
✗GET /restconf/data/Cisco-IOS-XE-native:interface/GigabitEthernet0/0 with Accept: application/yang-data+json; then PATCH same URI with Content-Type: application/yang-data+json and body {"Cisco-IOS-XE-native:interface":{"duplex":"full"}}; expect 204 No Content.Wrong answer — click to see why▾
Why this is wrong here
The specific factual error is that the duplex setting is defined in the ietf-interfaces YANG model, not in Cisco-IOS-XE-native. The URI path must match the data model.
Why candidates choose this
Candidates might assume that Cisco-specific modules are required for device configuration, but for standard interface settings like duplex, the IETF model is used.
✗GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0/0 with Accept: application/yang-data+json; then PATCH same URI with Content-Type: application/yang-data+json and body {"duplex":"full"}; expect 200 OK.Wrong answer — click to see why▾
Why this is wrong here
The specific factual errors are: (1) The PATCH body must be structured as {"ietf-interfaces:interface":{"duplex":"full"}} to match the YANG data tree; (2) The success response for PATCH is 204 No Content, not 200 OK.
Why candidates choose this
Candidates might think that sending only the leaf is sufficient and that 200 OK is the standard success response, but RESTCONF uses 204 for successful PATCH and requires the full data path.
Analysis generated from the official 200-301blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Agentic AI in Network Operations
Key term
YANG
YANG is a data modeling language used to define the structure and constraints of data exchanged between network devices and management applications.
Key term
RESTCONF
RESTCONF is a protocol that uses HTTP methods to manage and configure network devices, replacing older command-line methods with a modern web-based approach.
About these practice questions
This 200-301 question is part of Courseiva's 1,389-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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-301 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-301 exam.