mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Adds info either the server is started as a local server in VersionHandler response.
This commit is contained in:
parent
221befa73e
commit
a81d2274cd
@ -16,12 +16,11 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from ...web.route import Route
|
from ...web.route import Route
|
||||||
|
from ...config import Config
|
||||||
from ...schemas.version import VERSION_SCHEMA
|
from ...schemas.version import VERSION_SCHEMA
|
||||||
from ...version import __version__
|
from ...version import __version__
|
||||||
from aiohttp.web import HTTPConflict
|
from aiohttp.web import HTTPConflict
|
||||||
|
|
||||||
import asyncio
|
|
||||||
|
|
||||||
|
|
||||||
class VersionHandler:
|
class VersionHandler:
|
||||||
|
|
||||||
@ -31,7 +30,10 @@ class VersionHandler:
|
|||||||
description="Retrieve the server version number",
|
description="Retrieve the server version number",
|
||||||
output=VERSION_SCHEMA)
|
output=VERSION_SCHEMA)
|
||||||
def version(request, response):
|
def version(request, response):
|
||||||
response.json({"version": __version__})
|
|
||||||
|
config = Config.instance()
|
||||||
|
local_server =config.get_section_config("Server").getboolean("local", False)
|
||||||
|
response.json({"version": __version__, "local": local_server})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@Route.post(
|
@Route.post(
|
||||||
|
@ -24,6 +24,10 @@ VERSION_SCHEMA = {
|
|||||||
"version": {
|
"version": {
|
||||||
"description": "Version number human readable",
|
"description": "Version number human readable",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
},
|
||||||
|
"local": {
|
||||||
|
"description": "Either this is a local server",
|
||||||
|
"type": "boolean",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user