def index(req):
"""Respond to a request for all OpenStack Glare API versions.
:param req: user request object
:return: list of supported API versions
"""
version_objs = [
{
'version': '1.0',
'status': 'STABLE',
'links': _LINKS,
'media-type': 'application/vnd.openstack.artifacts-1.0',
},
{
'version': '1.1',
'status': 'EXPERIMENTAL',
'links': _LINKS,
'media-type': 'application/vnd.openstack.artifacts-1.1',
}]
response = webob.Response(request=req,
status=http_client.MULTIPLE_CHOICES,
content_type='application/json')
response.body = jsonutils.dump_as_bytes(dict(versions=version_objs))
return response
评论列表
文章目录