Commit e6a70854 authored by Giorgos Verigakis's avatar Giorgos Verigakis
Browse files

Add describedby links in version details

parent 9359b523
......@@ -15,7 +15,7 @@
<title type="text">Version {{ version.id }}</title>
<updated>{{ version.updated }}</updated>
{% for link in version.links %}
<link rel="{{ link.rel }}" href="{{ link.href }}"/>
<link rel="{{ link.rel }}" {% if link.type %}type="{{ link.type }}" {% endif %}href="{{ link.href }}"/>
{% endfor %}
<content type="text">Version {{ version.id }} {{ version.status }} ({{ version.updated }})</content>
</entry>
......
......@@ -7,7 +7,7 @@
{% endfor %}
</media-types>
{% for link in version.links %}
<atom:link rel="{{ link.rel }}" href="{{ link.href }}"/>
<atom:link rel="{{ link.rel }}" {% if link.type %}type="{{ link.type }}" {% endif %}href="{{ link.href }}"/>
{% endfor %}
</version>
{% endspaceless %}
......@@ -31,6 +31,18 @@ MEDIA_TYPES = [
{'base': 'application/json', 'type': 'application/vnd.openstack.compute-v1.1+json'}
]
DESCRIBED_BY = [
{
'rel' : 'describedby',
'type' : 'application/pdf',
'href' : 'http://docs.rackspacecloud.com/servers/api/v1.1/cs-devguide-20110125.pdf'
},
{
'rel' : 'describedby',
'type' : 'application/vnd.sun.wadl+xml',
'href' : 'http://docs.rackspacecloud.com/servers/api/v1.1/application.wadl'
}
]
@api_method('GET', atom_allowed=True)
def versions_list(request):
......@@ -58,6 +70,7 @@ def version_details(request, api_version):
# We hardcode to v1.1 since it is the only one we support
version = VERSION_1_1.copy()
version['links'] = version['links'] + DESCRIBED_BY
if request.serialization == 'xml':
version['media_types'] = MEDIA_TYPES
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment