~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/api/openstack/volume/versions.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
 
 
3
 
# Copyright 2010 OpenStack LLC.
4
 
# All Rights Reserved.
5
 
#
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
9
 
#
10
 
#         http://www.apache.org/licenses/LICENSE-2.0
11
 
#
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
16
 
#    under the License.
17
 
 
18
 
 
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
22
 
 
23
 
 
24
 
VERSIONS = {
25
 
    "v1.0": {
26
 
        "id": "v1.0",
27
 
        "status": "CURRENT",
28
 
        "updated": "2012-01-04T11:33:21Z",
29
 
        "links": [
30
 
            {
31
 
                "rel": "describedby",
32
 
                "type": "application/pdf",
33
 
                "href": "http://jorgew.github.com/block-storage-api/"
34
 
                        "content/os-block-storage-1.0.pdf",
35
 
            },
36
 
            {
37
 
                "rel": "describedby",
38
 
                "type": "application/vnd.sun.wadl+xml",
39
 
                #(anthony) FIXME
40
 
                "href": "http://docs.rackspacecloud.com/"
41
 
                        "servers/api/v1.1/application.wadl",
42
 
            },
43
 
        ],
44
 
        "media-types": [
45
 
            {
46
 
                "base": "application/xml",
47
 
                "type": "application/vnd.openstack.volume+xml;version=1",
48
 
            },
49
 
            {
50
 
                "base": "application/json",
51
 
                "type": "application/vnd.openstack.volume+json;version=1",
52
 
            }
53
 
        ],
54
 
    }
55
 
}
56
 
 
57
 
 
58
 
class Versions(versions.Versions):
59
 
    @wsgi.serializers(xml=versions.VersionsTemplate,
60
 
                      atom=versions.VersionsAtomSerializer)
61
 
    def index(self, req):
62
 
        """Return all versions."""
63
 
        builder = views_versions.get_view_builder(req)
64
 
        return builder.build_versions(VERSIONS)
65
 
 
66
 
    @wsgi.serializers(xml=versions.ChoicesTemplate)
67
 
    @wsgi.response(300)
68
 
    def multi(self, req):
69
 
        """Return multiple choices."""
70
 
        builder = views_versions.get_view_builder(req)
71
 
        return builder.build_choices(VERSIONS, req)
72
 
 
73
 
 
74
 
class VolumeVersionV1(object):
75
 
    @wsgi.serializers(xml=versions.VersionTemplate,
76
 
                      atom=versions.VersionAtomSerializer)
77
 
    def show(self, req):
78
 
        builder = views_versions.get_view_builder(req)
79
 
        return builder.build_version(VERSIONS['v1.0'])
80
 
 
81
 
 
82
 
def create_resource():
83
 
    return wsgi.Resource(VolumeVersionV1())