[openstack-dev] AVersion version selection application

Mellquist, Peter peter.mellquist at hp.com
Sat Feb 16 02:22:18 UTC 2013


Very nice Kevin!

Have you considered using regular expressions for URI matching?


Peter.

-----Original Message-----
From: Kevin L. Mitchell [mailto:kevin.mitchell at rackspace.com] 
Sent: Wednesday, February 13, 2013 11:29 AM
To: openstack-dev
Subject: [openstack-dev] AVersion version selection application

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>


_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list