300-435 Question 43
Single answerYou are tasked with automating network configurations using Cisco YANG Suite. You are provided with a YANG model describing interface configurations and need to generate a JSON instance for configuring an interface with the following details:
Interface: GigabitEthernet1 Description: 'Uplink Interface' Admin Status: 'Enabled' MTU: 1500
Which JSON instance correctly represents this configuration based on the YANG model?
- A
{ "interface": { "name": "GigabitEthernet1", "description": "Uplink Interface", "admin-status": "enabled", "mtu": 1500 } }
- B
{ "interfaces": { "interface": { "name": "GigabitEthernet1", "description": "Uplink Interface", "admin-status": "up", "mtu": 1500 } } }
- C
{ "interfaces": { "interface": [ { "name": "GigabitEthernet1", "description": "Uplink Interface", "enabled": true, "mtu": 1500 } ] } }
- D
{ "interfaces": { "interface": { "name": "GigabitEthernet1", "description": "Uplink Interface", "admin-status": "enabled", "mtu": "1500" } } }
Show answer and explanation
Correct answer: C
Explanation
The correct JSON instance must align with the structure outlined in the YANG model. Typically, interfaces are represented as arrays under the 'interfaces' key, and certain fields like 'enabled' are represented as booleans rather than strings. Option 3 correctly adheres to these conventions, making it the accurate representation.
- A. Incorrect.
This JSON structure does not align with the YANG model conventions. The key 'interface' should be part of an array under 'interfaces', and 'admin-status' should be 'enabled' as a boolean, not a string.
- B. Incorrect.
Although this JSON structure has some correct elements, it does not follow the correct YANG model representation. The 'interface' key should be an array, and 'admin-status' should be represented as a boolean (true/false), not 'up'.
- C. Correct.
This is the correct JSON instance as it complies with the YANG model conventions. The 'interface' key is an array, 'enabled' is used as a boolean (true), and all other fields are correctly formatted.
- D. Incorrect.
This JSON instance incorrectly uses 'admin-status' as a string ('enabled') and 'mtu' as a string ('1500'), which does not comply with the YANG model conventions.