Custom Search

Wednesday, March 26, 2014

OpenStack Heat How heat-api service loads URLs

a)
/opt/stack/heat/bin/heat-api
https://github.com/openstack/heat/blob/master/bin/heat-api

from oslo.config import cfg
from heat.common import config
from heat.common import wsgi

app = config.load_paste_app()
server = wsgi.Server()
server.start(app, cfg.CONF.heat_api, default_port=port)
server.wait()


----------

From my understanding, When we run the script https://github.com/openstack/heat/blob/master/bin/heat-api, that will load all urls defined in the https://github.com/openstack/heat/blob/master/heat/api/openstack/v1/__init__.py.

But in the script https://github.com/openstack/heat/blob/master/bin/heat-api, I could not find any line which specifying the name of https://github.com/openstack/heat/blob/master/heat/api/openstack/v1/__init__.py,  then how it loading that ?

* it's all defined in config files
* in /etc/heat/api-paste.ini
* in https://github.com/openstack/heat/blob/master/etc/heat/api-paste.ini
* [app:apiv1app]
* paste.app_factory = heat.common.wsgi:app_factory
* heat.app_factory = heat.api.openstack.v1:API
* See https://github.com/openstack/heat/blob/master/heat/api/openstack/v1/__init__.py
* that app gets added to the heat-api pipeline...
* # heat-api pipeline
* [pipeline:heat-api]
* pipeline = faultwrap ssl versionnegotiation authurl authtoken context apiv1app
* and config.load_paste_app() presumably loads that pipeline

4 comments:

  1. http://fosshelp.blogspot.in/2013/11/how-to-serve-app-using-python-paste.html
    http://fosshelp.blogspot.in/2013/11/working-of-openstack-keystone-service.html

    ReplyDelete
  2. OpenStack API and WSGI
    http://www.slideshare.net/lhrc_mikeyp/openstack-apis-and-wsgi

    ReplyDelete
  3. Getting Started with Python WSGI and Paste Deployment
    http://fosshelp.blogspot.com/2014/03/getting-started-with-python-wsgi-and.html

    ReplyDelete