hardMultiple Choice
350-401 Practice Question: Is automating the configuration of VLANs on a…
A network engineer is automating the configuration of VLANs on a Cisco Nexus 9000 switch using Python and the NX-API. The engineer sends a Python dictionary with the CLI commands to the API and receives a successful response. However, when checking the switch, the VLANs are not created. The engineer verifies that the credentials and IP address are correct, and the API is enabled. The engineer also notices that the API response contains a 'code' field of '200' and a 'result' field that shows the command output. What is the most likely cause of the issue?
⚠ Common exam trap
Cisco often tests the distinction between 'cli_show' and 'cli_conf' message types in NX-API, trapping candidates who assume a 200 response and command output guarantee that configuration changes were applied.
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
✓
The engineer used the 'show' message type in the API request instead of 'cli_conf'.
The NX-API requires the 'message' type to be set to 'cli_conf' for configuration commands. Using 'show' (the default) only executes show commands and returns output, but does not apply any configuration changes to the switch. Even though the API returns a 200 status code and command output, the configuration is not actually committed.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The API response code of 200 indicates an error, and the engineer should check for a different status code.
Why it's wrong here
NX-API returns HTTP 200 for any request that successfully reaches the switch and is parsed; the actual success or failure of the operation is coded in the `code` and `msg` fields inside the response body, not in the outer HTTP status. A 200 status simply means the HTTP request was delivered, so the engineer should inspect the inner fields for an error, not look for a different HTTP status code. Claiming a 200 indicates an error would divert attention from the real cause.
- ✗
The VLAN commands are incorrect; the engineer should use 'vlan 10' instead of 'vlan 10-20'.
Why it's wrong here
The `vlan 10-20` range syntax is valid on Nexus NX-OS and will create all VLANs in that range, so the command syntax is not the reason the changes are not taking effect. If the engineer only wanted VLAN 10, using `vlan 10` would be more precise, but that is a semantic choice rather than a correction of invalid syntax. The actual failure is that NX-API only applies configuration when the message type is set to `cli_conf`; the command itself is syntactically fine.
- ✓
The engineer used the 'show' message type in the API request instead of 'cli_conf'.
Why this is correct
In NX-API, the `type` field in the request payload determines how the switch processes the command. Sending `show` (or `cli_show`) tells the API to execute a read-only show command and return its output, so configuration commands are never executed and the switch configuration remains unchanged. To apply configuration changes, the engineer must set the message type to `cli_conf`, which places the switch in global configuration mode and executes the supplied commands. This mismatch between the API message type and the intended operation is the root cause of the problem.
- ✗
The switch requires a 'commit' command after configuration changes via NX-API.
Why it's wrong here
Standard Nexus NX-OS NX-API applies configuration changes immediately once a `cli_conf` request succeeds; there is no two-phase transaction or implicit commit requirement for ordinary API calls. The `commit` command is needed only when using features like `configure session`, where changes are staged in a candidate configuration and explicitly committed. Adding a `commit` command in a normal NX-API request would actually cause an error because the switch is not in a session mode, so this is not the reason the VLAN configuration is not applied.
Visual reference
Go deeper
Related to this question
About these practice questions
This 350-401 question is part of Courseiva's 1,923-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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-401 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-401 exam.