300-435 Question 102
Single answerYou are tasked with automating the configuration of network devices in your enterprise network using RESTCONF. During the process, you want to retrieve the current running configuration of a specific interface on a Cisco device. Which RESTCONF HTTP method and URI would you use?
- A
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
- B
POST /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
- C
PUT /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
- D
DELETE /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1
Show answer and explanation
Correct answer: A
Explanation
To retrieve the current running configuration of a specific interface using RESTCONF, you use the GET HTTP method along with the appropriate URI. The URI specifies the data model (ietf-interfaces in this case) and the target resource (the specific interface). This ensures that you can query and read the configuration without making any modifications.
- A. Correct.
The GET method is used to retrieve data from a resource. In this case, it retrieves the running configuration of the specified interface.
- B. Incorrect.
The POST method is used to create a new resource. It cannot be used to retrieve data, so this option is incorrect.
- C. Incorrect.
The PUT method is used to update or replace an existing resource. It is not suitable for retrieving data, so this option is incorrect.
- D. Incorrect.
The DELETE method is used to remove a resource. It has no role in retrieving data, so this option is incorrect.