200-901 exam dumps

200-901 practice question 24 of 204

Cisco DevNet Associate. Associate level, Cisco. Free question with the correct answer and a full explanation.

200-901 Question 24

Select 2

You are managing a network automation project using Python and the Cisco REST API. Your team needs to dynamically add and remove VLANs on a Cisco switch. Which REST API methods should you use to achieve this functionality?

  1. A

    POST for adding VLANs and DELETE for removing VLANs

  2. B

    PUT for adding VLANs and DELETE for removing VLANs

  3. C

    PATCH for modifying VLAN configurations and DELETE for removing VLANs

  4. D

    GET for retrieving VLAN information and POST for adding VLANs

  5. E

    DELETE for removing VLANs and GET for verifying VLAN removal

Show answer and explanation

Correct answers: A, C

Explanation

In REST APIs, the POST method is used to add new resources (e.g., VLANs), while DELETE is used to remove them. PATCH is useful for modifying existing configurations, such as adjusting VLAN parameters. These methods align with the Cisco DevNet Associate exam topic of adding and removing resources using APIs. Understanding the appropriate HTTP methods is crucial for implementing dynamic network management workflows with automation tools.

  • A. Correct.

    POST is the correct method to create or add new resources (like VLANs) in REST APIs, and DELETE is used to remove them. This is a valid option.

  • B. Incorrect.

    PUT is generally used to update or replace an existing resource rather than creating a new one. While DELETE is correct for removing VLANs, PUT is not the correct choice for adding them.

  • C. Correct.

    PATCH is commonly used for modifying parts of an existing resource, and DELETE is correct for removing VLANs. PATCH can be relevant when making changes to VLAN configurations, so this option is valid for scenarios involving modifications.

  • D. Incorrect.

    GET is used for retrieving data and is not suitable for adding resources. POST is correct for adding VLANs, but this option is partially correct and incomplete for the given scenario.

  • E. Incorrect.

    DELETE is correct for removing VLANs, and GET can be used to verify VLAN removal by retrieving the current VLAN list. However, GET is not involved in adding or removing VLANs directly, making this option incorrect.

Timed practice exam

Take a 200-901 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