mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Add api versionning
This commit is contained in:
1 parent
119bebee25
commit
08158884a4
3 files changed
+5
-4
No files matched your search
+2
-2
@@ -45,7 +45,7 @@ class Query:
|
||||
return self._fetch("DELETE", path, **kwargs)
|
||||
|
||||
def _get_url(self, path):
|
||||
return "http://{}:{}{}".format(self._host, self._port, path)
|
||||
return "http://{}:{}/v1{}".format(self._host, self._port, path)
|
||||
|
||||
def _fetch(self, method, path, body=None, **kwargs):
|
||||
"""Fetch an url, parse the JSON and return response
|
||||
@@ -74,7 +74,7 @@ class Query:
|
||||
asyncio.async(go(future, response))
|
||||
self._loop.run_until_complete(future)
|
||||
response.body = future.result()
|
||||
response.route = response.headers.get('X-Route', None)
|
||||
response.route = response.headers.get('X-Route', None).replace("/v1", "")
|
||||
|
||||
if response.body is not None:
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user