Commit dc824c9f authored by Oleksiy Mishchenko's avatar Oleksiy Mishchenko
Browse files

RAPI: Deprecate version Rapi version1

It is impossible to keep backward compatibility due to
significant changes in the Ganeti core.

Reviewed-by: iustinp
parent 68c6f21c
......@@ -119,18 +119,6 @@ CONNECTOR.update({
"/version": rlib1.R_version,
"/tags": rlib1.R_tags,
"/info": rlib1.R_info,
"/nodes": rlib2.R_nodes,
re.compile(r'^/nodes/([\w\._-]+)$'): rlib1.R_nodes_name,
re.compile(r'^/nodes/([\w\._-]+)/tags$'): rlib1.R_nodes_name_tags,
"/instances": rlib2.R_instances,
re.compile(r'^/instances/([\w\._-]+)$'): rlib1.R_instances_name,
re.compile(r'^/instances/([\w\._-]+)/tags$'): rlib1.R_instances_name_tags,
"/os": rlib1.R_os,
"/2/jobs": rlib2.R_2_jobs,
"/2/nodes": rlib2.R_2_nodes,
......
......@@ -48,16 +48,17 @@ class MapperTests(unittest.TestCase):
def testMapper(self):
"""Testing Mapper"""
self._TestUri("/tags", (rlib1.R_tags, [], {}))
self._TestUri("/instances", (rlib2.R_instances, [], {}))
self._TestFailingUri("/tags")
self._TestFailingUri("/instances")
self._TestUri("/version", (rlib1.R_version, [], {}))
self._TestUri('/instances/www.test.com',
self._TestUri('/2/instances/www.test.com',
(rlib1.R_instances_name,
['www.test.com'],
{}))
self._TestUri('/instances/www.test.com/tags?f=5&f=6&alt=html',
(rlib1.R_instances_name_tags,
self._TestUri('/2/instances/www.test.com/tags?f=5&f=6&alt=html',
(rlib2.R_2_instances_name_tags,
['www.test.com'],
{'alt': ['html'],
'f': ['5', '6'],
......@@ -75,11 +76,7 @@ class R_RootTests(unittest.TestCase):
def testGet(self):
expected = [
{'name': 'info', 'uri': '/info'},
{'name': 'instances', 'uri': '/instances'},
{'name': 'nodes', 'uri': '/nodes'},
{'name': 'os', 'uri': '/os'},
{'name': 'tags', 'uri': '/tags'},
# TODO: {'name': 'info', 'uri': '/2'},
{'name': 'version', 'uri': '/version'},
]
self.assertEquals(self.root.GET(), expected)
......
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