Repository URL to install this package:
Version:
4.1.94.1.dev5 ▾
|
# Copyright 2018 TrilioData Inc.
# All Rights Reserved.
from dmapi.api.openstack import api_version_request
from dmapi.api.openstack.dm.views import versions as views_versions
from dmapi.api.openstack import wsgi
LINKS = {
'v2.0': {
'html': 'http://docs.trilio.io/'
},
}
VERSIONS = {
"v2.0": {
"id": "v2.0",
"status": "SUPPORTED",
"version": "",
"min_version": "",
"updated": "2011-01-21T11:33:21Z",
"links": [
{
"rel": "describedby",
"type": "text/html",
"href": LINKS['v2.0']['html'],
},
],
"media-types": [
{
"base": "application/json",
"type": "application/vnd.trilio.dm+json;version=2",
}
],
},
}
class Versions(wsgi.Resource):
# The root version API isn't under the microversion control.
support_api_request_version = False
def __init__(self):
super(Versions, self).__init__(None)
def index(self, req, body=None):
"""Return all versions."""
builder = views_versions.get_view_builder(req)
return builder.build_versions(VERSIONS)
@wsgi.response(300)
def multi(self, req, body=None):
"""Return multiple choices."""
builder = views_versions.get_view_builder(req)
return builder.build_choices(VERSIONS, req)
def get_action_args(self, request_environment):
"""Parse dictionary created by routes library."""
args = {}
if request_environment['PATH_INFO'] == '/':
args['action'] = 'index'
else:
args['action'] = 'multi'
return args