300-435 Question 194
Single answerYou are automating network troubleshooting tasks in Cisco DNA Center using Command Runner APIs. You need to execute a show command to retrieve interface details from a specific network device. What is a required step to ensure the API call executes successfully?
- A
Specify the device's management IP address in the API payload.
- B
Include the desired show commands in the body of the API request payload.
- C
Use a GET method to retrieve the interface details from the device.
- D
Provide the device's hostname in the API URL.
Show answer and explanation
Correct answer: B
Explanation
To execute a command using the Command Runner API, you must include the desired show commands in the body of the API request payload. This ensures the API knows exactly what commands to run on the target device. Other details, like the device ID, are typically specified in the payload or context, but the command itself is a mandatory part of the request.
- A. Incorrect.
While specifying the device's management IP address is useful in some scenarios, it is not a required step in the Command Runner API for executing commands. The device can be identified using its ID or other identifiers.
- B. Correct.
Including the desired show commands in the API request payload is required because it tells the Command Runner API what specific commands to execute on the target device.
- C. Incorrect.
The Command Runner API requires a POST method to submit commands for execution, not a GET method. Using GET would not initiate the command execution process.
- D. Incorrect.
Providing the device's hostname in the API URL is not a requirement for the Command Runner API. The device is typically identified using its unique identifier within Cisco DNA Center.