Building Network Web Services with Python
In the previous chapters, we were a consumer of the APIs provided by others. In Chapter 3, APIs and Intent-Driven Networking, we saw that we can use an HTTP POST
request to NX-API at the http://<your router ip>/ins
URL with the CLI
command embedded in the HTTP POST
body to execute commands remotely on the Cisco Nexus device; the device then returns the command execution output in its HTTP response return. In Chapter 8, Network Monitoring with Python – Part 2, we used the HTTP GET
method for our sFlow-RT at http://<your host ip>:8008/version
with an empty body to retrieve the version of the sFlow-RT software. These request-response exchanges are examples of RESTful web services.
According to Wikipedia (https://en.wikipedia.org/wiki/Representational_state_transfer):
"Representational state transfer (REST) or RESTful web services is one way of providing interoperability between computer systems on the internet. REST...