SONiC Management Framework provides various common North Bound Interfaces (NBIs) for managing configuration and retrieving status on SONiC switches. SONiC Management Framework includes support for NBIs such as CLI, gNMI, and REST. A use case includes using a REST client by the user to perform POST, PUT, PATCH, DELETE, GET operations on the supported data models, and URL paths. The management REST server leverages the HTTP/HTTPS protocol.
Note: For more information, see https://github.com/project-arlo/SONiC/blob/master/doc/mgmt/Management%20Framework.md#3122-REST.
Consider the use case example of accessing the REST API using the management IP address of the switch for viewing switch information. The management IP address of the switch in this example is 100.67.204.213. To access the REST API, in a web browser, type:
https://100.67.204.213/ui
Figure 11: SONiC REST API explorer
Select the REST API for openconfig-platform. This will open the page for selected REST API. The page will list all the REST API paths and each action available such as GET, POST, PATCH, DELETE, and PUT. Once it is executed, the tool fetches the data via REST API with the "components" data, as shown in the following figure.
Figure 12: Switch data retrieval using REST API for openconfig-platform