350-401 Question 317
Single answerYou are tasked with creating a JSON-encoded file that will be used to configure a network device. The file should include the following details: the hostname 'Router1', an interface 'GigabitEthernet0/0' with an IP address of '192.168.1.1' and a subnet mask of '255.255.255.0', and a description 'Main WAN Interface'. Which of the following JSON structures is valid and meets the requirements?
- A
{ "hostname": "Router1", "interfaces": [{ "name": "GigabitEthernet0/0", "ip_address": "192.168.1.1", "subnet_mask": "255.255.255.0", "description": "Main WAN Interface" }] }
- B
{ hostname: "Router1", interfaces: [{ name: "GigabitEthernet0/0", ip_address: "192.168.1.1", subnet_mask: "255.255.255.0", description: "Main WAN Interface" }] }
- C
{ "hostname": "Router1", "interfaces": { "GigabitEthernet0/0": { "ip_address": "192.168.1.1", "subnet_mask": "255.255.255.0", "description": "Main WAN Interface" } } }
- D
{ "hostname": "Router1", "interfaces": [{ "name": "GigabitEthernet0/0", "ip": "192.168.1.1", "mask": "255.255.255.0", "desc": "Main WAN Interface" }] }
Show answer and explanation
Correct answer: A
Explanation
The correct answer must follow proper JSON syntax, including double quotes for all keys and string values. It must also match the specified structure, including a hostname and an array of interfaces with the required key names. Option 1 is the only JSON structure that meets all these criteria.
- A. Correct.
This option is correct because it uses proper JSON syntax, including double quotes around keys and values, and adheres to the required structure with a hostname and an array of interface configurations.
- B. Incorrect.
This option is invalid because it uses unquoted keys, which is not allowed in JSON.
- C. Incorrect.
This option is invalid because the 'interfaces' key is not an array, as required by the scenario, and does not meet the specified format.
- D. Incorrect.
This option is invalid because the keys 'ip', 'mask', and 'desc' do not match the specified requirements ('ip_address', 'subnet_mask', and 'description').