350-401 exam dumps

350-401 practice question 316 of 631

Implementing Cisco Enterprise Network Core Technologies. Professional level, Cisco. Free question with the correct answer and a full explanation.

350-401 Question 316

Single answer

You are tasked with creating a JSON configuration file for a network automation tool. The file needs to define the following properties:

  1. A 'host' field that specifies the IP address '192.168.1.1'.
  2. A 'port' field set to the integer value 22.
  3. A 'protocols' field that lists the supported protocols: 'SSH' and 'HTTPS'.
  4. A 'credentials' object that contains a 'username' field set to 'admin' and a 'password' field set to 'cisco123'.

Which of the following JSON files is valid and meets the requirements?

  1. A

    { "host": "192.168.1.1", "port": 22, "protocols": ["SSH", "HTTPS"], "credentials": { "username": "admin", "password": "cisco123" } }

  2. B

    { "host": 192.168.1.1, "port": "22", "protocols": "SSH, HTTPS", "credentials": { "username": "admin", "password": "cisco123" } }

  3. C

    { "host": "192.168.1.1", "port": 22, "protocols": ["SSH", "HTTPS"], "credentials": ["username": "admin", "password": "cisco123"] }

  4. D

    { "host": "192.168.1.1", "port": 22, "protocols": ["SSH", "HTTPS"], "credentials": { "username": "admin", "password": "cisco123" }, }

Show answer and explanation

Correct answer: A

Explanation

JSON files must follow strict syntax rules. Keys and string values must be enclosed in double quotes, lists should use square brackets, and objects should use curly braces. The trailing comma in option 4 is invalid, and other options fail to meet the required structure or formatting.

  • A. Correct.

    This is the correct JSON structure. The 'host' is a string, 'port' is an integer, 'protocols' is a list of strings, and 'credentials' is a nested object with correct key-value pairs.

  • B. Incorrect.

    This JSON is invalid because the 'host' field is not quoted as a string, the 'port' is incorrectly quoted as a string, and the 'protocols' field is improperly formatted as a single string instead of a list.

  • C. Incorrect.

    This JSON is invalid because the 'credentials' field is incorrectly formatted as a list instead of an object with key-value pairs.

  • D. Incorrect.

    This JSON is invalid because there is a trailing comma after the 'credentials' object, which violates JSON syntax rules.

Timed practice exam

Take a 350-401 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam