Python is one of many programming languages that is widely used for automating networks. There is no built-in REST or HTTP client in Python, but Python allows importing libraries, functions, modules, or frameworks. One of the libraries that can be used to send HTTP REST API requests is the requests library—an Apache2 Licensed HTTP library written in Python. In this recipe, we will import and leverage the requests library to perform a REST API call to NSX in Python version 2.7.
Using the REST API with Python
Getting ready
- Make sure you have Python and the requests library installed. Python comes pre-installed on many Linux/Unix operating systems. If you do not have Python installed, head over to https://www.python.org...