tacker/doc/source/contributor/api_layer.rst
Manpreet Kaur 073f293cc3 Fix for old links in Tacker WSGI/HTTP API layer
* Change reference links for tacker source code from [1] to [2].
* Update broken links for Python Paste.
[1] https://opendev.org/openstack/tacker/tree/
[2] https://opendev.org/openstack/tacker/src/branch/master

Change-Id: I2e95faf2584f78a1f8694486d3ffd8a596109133
Closes-Bug: #1889200
2020-07-29 17:01:16 +00:00

2.2 KiB

Tacker WSGI/HTTP API layer

This section will cover the internals of Tacker's HTTP API, and the classes in Tacker that can be used to create Extensions to the Tacker API.

Python web applications interface with webservers through the Python Web Server Gateway Interface (WSGI) - defined in PEP 333

Startup

Tackers's WSGI server is started from the server module and the entry point serve_wsgi is called to build an instance of the TackerApiService, which is then returned to the server module, which spawns a Eventlet GreenPool that will run the WSGI application and respond to requests from clients.

WSGI Application

During the building of the TackerApiService, the _run_wsgi function creates a WSGI application using the load_paste_app function inside config.py - which parses api-paste.ini - in order to create a WSGI app using Paste's deploy.

The api-paste.ini file defines the WSGI applications and routes - using the Paste INI file format.

The INI file directs paste to instantiate the APIRouter class of Tacker, which contains several methods that map VNFM resources (such as vnfd, vnf) to URLs, and the controller for each resource.

Further reading

Tacker wsgi is based on neutron's extension. The following doc is still relevant.

Yong Sheng Gong: Deep Dive into Neutron