300-435 exam dumps

300-435 practice question 84 of 322

Automating Cisco Enterprise Solutions. Professional level, Cisco. Free question with the correct answer and a full explanation.

300-435 Question 84

Select 4

You are tasked with configuring a Cisco device using RESTCONF API to update the hostname of the device. Using Python's requests library, which steps are necessary to successfully perform this operation?

  1. A

    Send a POST request to the RESTCONF base URL with the updated hostname in the request body.

  2. B

    Include the Content-Type: application/yang-data+json header in the HTTP request.

  3. C

    Authenticate the RESTCONF request using basic authentication with the device's username and password.

  4. D

    Use the PUT HTTP method to send the updated hostname to the appropriate RESTCONF URI.

  5. E

    Ensure the RESTCONF API is enabled and properly configured on the device before making the request.

Show answer and explanation

Correct answers: B, C, D, E

Explanation

To configure a Cisco device using RESTCONF API, you must ensure the device is properly set up to accept RESTCONF requests, authenticate the request, and use the correct HTTP method (PUT) with appropriate headers (Content-Type: application/yang-data+json) and request body. The POST method is not applicable for updating resources like the hostname.

  • A. Incorrect.

    POST is not the correct HTTP method for updating an existing resource like the hostname. PUT is used for this purpose.

  • B. Correct.

    The Content-Type: application/yang-data+json header ensures the request is understood as JSON-formatted data, which is required for RESTCONF communication.

  • C. Correct.

    RESTCONF typically requires basic authentication or other authentication mechanisms to authorize API requests.

  • D. Correct.

    PUT is the correct HTTP method to update a resource like the hostname in RESTCONF.

  • E. Correct.

    RESTCONF must be enabled and configured on the device for any RESTCONF API operations to succeed.

Timed practice exam

Take a 300-435 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