[openstack-dev] AVersion version selection application
Kevin L. Mitchell
kevin.mitchell at rackspace.com
Wed Feb 13 19:28:33 UTC 2013
I have just completed writing a composite application for version
selection. This could replace Nova's URLMap application, and could be
used by other projects to allow API version selection. I have dubbed
this piece of code, "AVersion," and it is available on PyPi. Here are
the links:
* http://pypi.python.org/pypi/aversion
* https://github.com/klmitch/aversion
I've written an extensive README describing what AVersion does and how
it does it, but here's a quick summary:
AVersion is a composite application, similar to the Paste urlmap. It is
configured with several different applications--each of which represents
a different version of the desired end application. It can also be
configured with a special application which handles unversioned API
requests, e.g., by returning a list of the available versions. AVersion
then selects the appropriate application to pass a given request to,
based on the URI prefix, or a version parameter on the content type or
types specified in the "Content-Type" or "Accept" headers. In addition,
AVersion can determine the best content type for the reply, based on the
URI suffix (e.g., ".json" could map to content type "application/json")
or the "Accept" header.
I wrote AVersion to be compatible with the existing Nova version
selection algorithm; it uses the same ordering and techniques, and
should be usable as a drop-in replacement, with the appropriate
configuration. The configuration is admittedly rather complex, and is
fully documented in the README, available at:
http://pypi.python.org/pypi/aversion
--
Kevin L. Mitchell <kevin.mitchell at rackspace.com>
More information about the OpenStack-dev
mailing list