350-501 Automation and Quality of Services Practice Question
An SP uses NSO with a YANG service model to provision an L3VPN. The service model references a leafref to a VPN ID that must exist in a separate list. Which YANG statement ensures the leafref value is valid against the referenced list?
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
✓
type leafref { path '/vpn-list/vpn-id'; }
leafref automatically validates that the leaf value matches a leaf in the referenced path.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
must 'current() = /vpn-list/vpn-id';
Why it's wrong here
This must expression would be complex and not standard; leafref is designed for this.
- ✓
type leafref { path '/vpn-list/vpn-id'; }
Why this is correct
leafref with path ensures the value exists in the referenced leaf.
- ✗
mandatory true;
Why it's wrong here
Mandatory ensures presence, not validity against a list.
- ✗
type string { pattern '[0-9]+'; }
Why it's wrong here
Pattern only validates format, not existence.
Go deeper
Related to this question
About these practice questions
One of 971 original 350-501 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 350-501 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-501 exam.