diff options
| author | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-09-20 21:38:38 +0000 |
|---|---|---|
| committer | Tarmac <> | 2010-09-20 21:38:38 +0000 |
| commit | d8861d04a85044ae57ffd7eb9ab682879beecf7d (patch) | |
| tree | a2151052c36ee84e6b7e1b6b0c62e6783dee6753 /nova/api | |
| parent | b9b65e76858f4a154b9e6bd8ff7cb1a715696894 (diff) | |
| parent | fc93548e99dea561dbf2f198b0fccc84467dbf8b (diff) | |
| download | nova-d8861d04a85044ae57ffd7eb9ab682879beecf7d.tar.gz nova-d8861d04a85044ae57ffd7eb9ab682879beecf7d.tar.xz nova-d8861d04a85044ae57ffd7eb9ab682879beecf7d.zip | |
Support querying version list, per the RS API spec. Fixes bug 613117.
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/api/__init__.py b/nova/api/__init__.py index b9b9e3988..9f116dada 100644 --- a/nova/api/__init__.py +++ b/nova/api/__init__.py @@ -21,6 +21,7 @@ Root WSGI middleware for all API controllers. """ import routes +import webob.dec from nova import wsgi from nova.api import ec2 @@ -32,6 +33,18 @@ class API(wsgi.Router): def __init__(self): mapper = routes.Mapper() + mapper.connect("/", controller=self.versions) mapper.connect("/v1.0/{path_info:.*}", controller=rackspace.API()) mapper.connect("/ec2/{path_info:.*}", controller=ec2.API()) super(API, self).__init__(mapper) + + @webob.dec.wsgify + def versions(self, req): + """Respond to a request for all OpenStack API versions.""" + response = { + "versions": [ + dict(status="CURRENT", id="v1.0")]} + metadata = { + "application/xml": { + "attributes": dict(version=["status", "id"])}} + return wsgi.Serializer(req.environ, metadata).to_content_type(response) |
