Revision 2af5dc96 snf-cyclades-app/synnefo/api/versions.py

b/snf-cyclades-app/synnefo/api/versions.py
45 45
log = getLogger('synnefo.api')
46 46

  
47 47

  
48
VERSION_1_1 = {
49
    'id': 'v1.1',
50
    'status': 'CURRENT',
51
    'updated': '2011-04-01',
52
    'links': [
48
VERSION_2_0 = {
49
    "id" : "v2.0",
50
    "status" : "CURRENT",
51
    "updated" : "2011-01-21T11:33:21-06:00",
52
    "links": [
53 53
        {
54
            'rel': 'self',
55
            'href': COMPUTE_ROOT_URL,
56
        }
57
    ]
54
            "rel" : "self",
55
            "href" : COMPUTE_ROOT_URL,
56
        },
57
    ],
58 58
}
59 59

  
60
VERSIONS = [VERSION_1_1]
60
VERSIONS = [VERSION_2_0]
61 61

  
62 62
MEDIA_TYPES = [
63
    {'base': 'application/xml',
64
     'type': 'application/vnd.openstack.compute-v1.1+xml'},
65
    {'base': 'application/json',
66
     'type': 'application/vnd.openstack.compute-v1.1+json'}
63
    {
64
        "base" : "application/xml",
65
        "type" : "application/vnd.openstack.compute.v2+xml"
66
    },
67
    {
68
        "base" : "application/json",
69
        "type" : "application/vnd.openstack.compute.v2+json"
70
    }
67 71
]
68 72

  
69 73
DESCRIBED_BY = [
70
    {'rel': 'describedby',
71
     'type': 'application/pdf',
72
     'href': "http://docs.rackspacecloud.com/servers/api/"
73
             "v1.1/cs-devguide-20110125.pdf"},
74
    {'rel': 'describedby',
75
     'type': 'application/vnd.sun.wadl+xml',
76
     'href': "http://docs.rackspacecloud.com/servers/api/v1.1/"
77
             "application.wadl"}
74
    {
75
        "rel" : "describedby",
76
        "type" : "application/pdf",
77
        "href" : "http://docs.rackspacecloud.com/servers/api/v2/cs-devguide-20110125.pdf"
78
    },
79
    {
80
        "rel" : "describedby",
81
        "type" : "application/vnd.sun.wadl+xml",
82
        "href" : "http://docs.rackspacecloud.com/servers/api/v2/application.wadl"
83
    }
78 84
]
79 85

  
80 86

  
......
101 107
    #                       overLimit(413)
102 108

  
103 109
    log.debug('version_details %s', api_version)
104
    # We hardcode to v1.1 since it is the only one we support
105
    version = VERSION_1_1.copy()
110
    # We hardcode to v2.0 since it is the only one we support
111
    version = VERSION_2_0.copy()
106 112
    version['links'] = version['links'] + DESCRIBED_BY
107 113

  
108 114
    if request.serialization == 'xml':

Also available in: Unified diff