Utility methods for working with WSGI servers
Bases: object
Maps method name to local methods through action name.
Find and call local method.
Bases: object
Base WSGI application wrapper. Subclasses need to implement __call__.
Used for paste app factories in paste.deploy config files.
Any local configuration (that is, values under the [app:APPNAME] section of the paste config) will be passed into the __init__ method as kwargs.
A hypothetical configuration would look like:
[app:wadl] latest_version = 1.3 paste.app_factory = nova.api.fancy_api:Wadl.factory
which would result in a call to the Wadl class as
import quantum.api.fancy_api fancy_api.Wadl(latest_version=‘1.3’)
You could of course re-implement the factory method in subclasses, but using the kwarg passing it shouldn’t be necessary.
Bases: object
WSGI app that dispatched to methods.
WSGI app that reads routing information supplied by RoutesMiddleware and calls the requested action method upon itself. All action methods must, in addition to their normal parameters, accept a ‘req’ argument which is the incoming wsgi.Request. They raise a webob.exc exception, or return a dict which will be serialized by requested content type.
Provide the XML namespace to use if none is otherwise specified.
Bases: quantum.wsgi.Middleware
Helper class that can be inserted into any WSGI application chain to get information about the request and response.
Iterator that prints the contents of a wrapper string iterator when iterated.
Bases: quantum.wsgi.ActionDispatcher
Default request body serialization
Bases: webob.exc.HTTPException
Generates an HTTP response from a webob HTTP exception
Bases: quantum.wsgi.TextDeserializer
Bases: quantum.wsgi.DictSerializer
Default JSON request body serialization
Bases: object
Base WSGI middleware wrapper. These classes require an application to be initialized that will be called next. By default the middleware will simply call its wrapped app, or you can override __call__ to customize its behavior.
Used for paste app factories in paste.deploy config files.
Any local configuration (that is, values under the [filter:APPNAME] section of the paste config) will be passed into the __init__ method as kwargs.
A hypothetical configuration would look like:
[filter:analytics] redis_host = 127.0.0.1 paste.filter_factory = nova.api.analytics:Analytics.factory
which would result in a call to the Analytics class as
import nova.api.analytics analytics.Analytics(app_from_paste, redis_host=‘127.0.0.1’)
You could of course re-implement the factory method in subclasses, but using the kwarg passing it shouldn’t be necessary.
Called on each request.
If this returns None, the next application down the stack will be executed. If it returns a response then that response will be returned and execution will stop here.
Do whatever you’d like to the response.
Bases: xml.etree.ElementTree.XMLTreeBuilder
Bases: webob.request.Request
Determine the most acceptable content-type.
Bases: object
Break up a Request object into more useful pieces.
Extract necessary pieces of the request.
| Parameters: | request – Request object |
|---|
Parse dictionary created by routes library.
Bases: quantum.wsgi.ActionDispatcher
Default request headers deserializer
Bases: quantum.wsgi.Application
WSGI app that handles (de)serialization and controller dispatch.
WSGI app that reads routing information supplied by RoutesMiddleware and calls the requested action method upon its controller. All controller action methods must accept a ‘req’ argument, which is the incoming wsgi.Request. If the operation is a PUT or POST, the controller method must also accept a ‘body’ argument (the deserialized request body). They may raise a webob.exc exception or return a dict, which will be serialized by requested content type.
Find action-spefic method on controller and call it.
Bases: quantum.wsgi.ActionDispatcher
Default response headers serialization
Bases: object
Encode the necessary pieces into a response object
Serialize a dict into a string and wrap in a wsgi.Request object.
| Parameters: |
|
|---|
Bases: object
WSGI middleware that maps incoming requests to WSGI apps.
Returns an instance of the WSGI Router class
Bases: object
Serializes and deserializes dictionaries to certain MIME types.
Deserialize a string to a dictionary.
The string must be in the format of a supported MIME type.
Serialize a dictionary into the specified content type.
Bases: object
Server class to manage multiple WSGI sockets and applications.
Run a WSGI server with the given application.
Wait until all servers have completed running.
Bases: quantum.wsgi.ActionDispatcher
Default request body deserialization
Bases: quantum.wsgi.TextDeserializer
Bases: quantum.wsgi.DictSerializer
| Parameters: | data – expect data to contain a single key as XML root, or |
|---|
contain another ‘*_links’ key as atom links. Other case will use ‘VIRTUAL_ROOT_KEY’ as XML root.
Run a WSGI server with the given application.