Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is api-paste.ini file in openstack

I've seen api-paste.ini as a conf file after installing openstack. It looks like substituting some prefixes for python implementation but have no clue about this. Here, my questions are:

What script is it? it looks like very bizarre grammar like the following:

[composite:metadata]
use = egg:Paste#urlmap
/: meta

How does it work within python script?

like image 945
jaeyong Avatar asked Sep 23 '13 05:09

jaeyong


1 Answers

See documentation for Paste Deploy.

The api-paste.ini is the configuration for the above web-services framework. Paste.deploy allows you to separate concerns between writing your application and middleware/filters from the composition of them into a web service. You define you WSGI applications and any middleware filters in the configuration file then you can compose pipelines which include the middleware/filters you want into your web-service, e.g. authentication, rate-limiting, etc.
You want to temporarily remove authentication, take it out of your pipeline and restart your web service. The declaration above is declaring a composite application, but with only one application binding (a bit unnecessary - normally you would expect to see more than one binding, e.g. for different versions of the application). The WSGI application app:meta will be bound to / and you should have a declaration of app:meta later in the file. The implementation of the composite app is declared via the use and the egg:Paste#urlmap is a simple reference implementation.
You load this in your program with paste.deploy.loadwsgi.loadapp(). There is a proposal/recommendation(?) to move away from Paste Deploy/WebOb to WSME/Pecan see OpenStack Common WSGI
like image 60
AChampion Avatar answered Nov 18 '22 11:11

AChampion