300-435 Question 35
Single answerAn enterprise network engineer is tasked with automating the configuration and monitoring of network devices using APIs. The engineer decides to use RESTCONF to retrieve interface information from a Cisco router. Which HTTP method and URI should the engineer use to fetch information about the 'GigabitEthernet1' interface in a RESTCONF-compliant way?
- A
POST /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
- B
PUT /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
- C
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
- D
DELETE /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
Show answer and explanation
Correct answer: C
Explanation
In RESTCONF, the GET method is used to retrieve data from a network device, such as interface information. The URI provided in the correct option adheres to the RESTCONF data model, specifically targeting the 'GigabitEthernet1' interface under 'ietf-interfaces:interfaces'. This makes GET the correct choice for the task described in the scenario.
- A. Incorrect.
POST is used to create a new resource in RESTCONF, not to retrieve information. It is incorrect for fetching interface data.
- B. Incorrect.
PUT is used to update or replace an existing resource in RESTCONF. It is not used for retrieving information.
- C. Correct.
GET is the correct HTTP method for retrieving data in RESTCONF. The specified URI is correctly formatted to fetch information about the 'GigabitEthernet1' interface.
- D. Incorrect.
DELETE is used to remove a resource in RESTCONF. It is not suitable for retrieving interface information.