1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2010 OpenStack LLC.
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may
7
# not use this file except in compliance with the License. You may obtain
8
# a copy of the License at
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
# License for the specific language governing permissions and limitations
19
from nova.api.openstack.compute import versions
20
from nova.api.openstack.volume.views import versions as views_versions
21
from nova.api.openstack import wsgi
28
"updated": "2012-01-04T11:33:21Z",
32
"type": "application/pdf",
33
"href": "http://jorgew.github.com/block-storage-api/"
34
"content/os-block-storage-1.0.pdf",
38
"type": "application/vnd.sun.wadl+xml",
40
"href": "http://docs.rackspacecloud.com/"
41
"servers/api/v1.1/application.wadl",
46
"base": "application/xml",
47
"type": "application/vnd.openstack.volume+xml;version=1",
50
"base": "application/json",
51
"type": "application/vnd.openstack.volume+json;version=1",
58
class Versions(versions.Versions):
59
@wsgi.serializers(xml=versions.VersionsTemplate,
60
atom=versions.VersionsAtomSerializer)
62
"""Return all versions."""
63
builder = views_versions.get_view_builder(req)
64
return builder.build_versions(VERSIONS)
66
@wsgi.serializers(xml=versions.ChoicesTemplate)
69
"""Return multiple choices."""
70
builder = views_versions.get_view_builder(req)
71
return builder.build_choices(VERSIONS, req)
74
class VolumeVersionV1(object):
75
@wsgi.serializers(xml=versions.VersionTemplate,
76
atom=versions.VersionAtomSerializer)
78
builder = views_versions.get_view_builder(req)
79
return builder.build_version(VERSIONS['v1.0'])
82
def create_resource():
83
return wsgi.Resource(VolumeVersionV1())