diff --git a/gns3server/handlers/api/controller/node_handler.py b/gns3server/handlers/api/controller/node_handler.py index cc01c8ed..e2a394d5 100644 --- a/gns3server/handlers/api/controller/node_handler.py +++ b/gns3server/handlers/api/controller/node_handler.py @@ -55,6 +55,20 @@ class NodeHandler: response.set_status(201) response.json(node) + @Route.get( + r"/projects/{project_id}/nodes", + parameters={ + "project_id": "Project UUID" + }, + status_codes={ + 200: "List of nodes returned", + }, + description="List nodes of a project") + async def list_nodes(request, response): + + project = await Controller.instance().get_loaded_project(request.match_info["project_id"]) + response.json([v for v in project.nodes.values()]) + @Route.get( r"/projects/{project_id}/nodes/{node_id}", status_codes={ @@ -70,19 +84,6 @@ class NodeHandler: response.set_status(200) response.json(node) - @Route.get( - r"/projects/{project_id}/nodes", - parameters={ - "project_id": "Project UUID" - }, - status_codes={ - 200: "List of nodes returned", - }, - description="List nodes of a project") - async def list_nodes(request, response): - - project = await Controller.instance().get_loaded_project(request.match_info["project_id"]) - response.json([v for v in project.nodes.values()]) @Route.put( r"/projects/{project_id}/nodes/{node_id}", diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py index e115fa5a..86c02a2b 100644 --- a/gns3server/web/web_server.py +++ b/gns3server/web/web_server.py @@ -277,6 +277,7 @@ class WebServer: for method, route, handler in Route.get_routes(): log.debug("Adding route: {} {}".format(method, route)) cors.add(self._app.router.add_route(method, route, handler)) + for module in MODULES: log.debug("Loading module {}".format(module.__name__)) m = module.instance()