350-401 Question 315
Single answerYou are tasked with creating a JSON-encoded configuration file to define a VLAN and its properties for a Cisco network automation task. The file must include the VLAN ID, VLAN name, and status. Identify the valid JSON-encoded file from the options below.
- A
{ "vlan": { "id": 10, "name": "Management", "status": "active" } }
- B
{ vlan: { id: 10, name: "Management", status: "active" } }
- C
{ "vlan": { "id": "10", "name": "Management", "status": "active" }
- D
{ "vlan": { "id": 10, "name": "Management", "state": "active" } }
Show answer and explanation
Correct answer: A
Explanation
JSON-encoded files require strict adherence to syntax rules, including the use of double quotes around keys and string values, and proper nesting with braces. Option 1 meets all these requirements and accurately represents the data structure specified in the task.
- A. Correct.
This is a valid JSON-encoded file. It uses proper syntax, with double quotes around keys and string values, and represents the data in a hierarchical structure.
- B. Incorrect.
This is invalid JSON because it does not use double quotes around the keys, which is mandatory in JSON.
- C. Incorrect.
This is invalid JSON because it has a missing closing brace at the end of the object.
- D. Incorrect.
This is invalid JSON because the key 'state' is incorrectly used instead of 'status', which does not meet the given requirements.