mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 14:51:13 +02:00
Return just version number for API /v1/version for compatibility
This commit is contained in:
6 files changed
+20
-11
No files matched your search
@@ -20,5 +20,3 @@ from gns3server.handlers.index_handler import IndexHandler
|
||||
|
||||
from gns3server.handlers.api.controller import *
|
||||
from gns3server.handlers.api.hypervisor import *
|
||||
|
||||
|
||||
@@ -17,5 +17,3 @@
|
||||
|
||||
from .server_handler import ServerHandler
|
||||
from .version_handler import VersionHandler
|
||||
|
||||
|
||||
@@ -36,5 +36,3 @@ if sys.platform.startswith("linux") or hasattr(sys, "_called_from_test") or os.e
|
||||
if not sys.platform.startswith("win"):
|
||||
from .iou_handler import IOUHandler
|
||||
from .docker_handler import DockerHandler
|
||||
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from ..web.route import Route
|
||||
from ..modules.port_manager import PortManager
|
||||
from ..modules.project_manager import ProjectManager
|
||||
from ..version import __version__
|
||||
|
||||
|
||||
class IndexHandler:
|
||||
@@ -24,8 +26,7 @@ class IndexHandler:
|
||||
@classmethod
|
||||
@Route.get(
|
||||
r"/",
|
||||
description="Home page for GNS3Server",
|
||||
api_version=None
|
||||
description="Home page for GNS3Server"
|
||||
)
|
||||
def index(request, response):
|
||||
response.template("index.html")
|
||||
@@ -33,11 +34,18 @@ class IndexHandler:
|
||||
@classmethod
|
||||
@Route.get(
|
||||
r"/status",
|
||||
description="Ressources used by GNS3Server",
|
||||
api_version=None
|
||||
description="Ressources used by GNS3Server"
|
||||
)
|
||||
def ports(request, response):
|
||||
response.template("status.html",
|
||||
port_manager=PortManager.instance(),
|
||||
project_manager=ProjectManager.instance()
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@Route.get(
|
||||
r"/v1/version",
|
||||
description="Old API"
|
||||
)
|
||||
def get_v1(request, response):
|
||||
response.json({"version": __version__})
|
||||
Reference in new issue
Block a user