mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-24 15:58:08 +00:00
Project handler use ProjectManager
This commit is contained in:
parent
f0094cc0d0
commit
ed973dbcf2
@ -1,8 +1,8 @@
|
|||||||
curl -i -xPOST 'http://localhost:8000/project' -d '{"location": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-240/test_create_project_with_dir0"}'
|
curl -i -xPOST 'http://localhost:8000/project' -d '{"location": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-253/test_create_project_with_dir0"}'
|
||||||
|
|
||||||
POST /project HTTP/1.1
|
POST /project HTTP/1.1
|
||||||
{
|
{
|
||||||
"location": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-240/test_create_project_with_dir0"
|
"location": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-253/test_create_project_with_dir0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -15,6 +15,6 @@ SERVER: Python/3.4 aiohttp/0.13.1
|
|||||||
X-ROUTE: /project
|
X-ROUTE: /project
|
||||||
|
|
||||||
{
|
{
|
||||||
"location": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-240/test_create_project_with_dir0",
|
"location": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-253/test_create_project_with_dir0",
|
||||||
"uuid": "16c371ee-728c-4bb3-8062-26b9313bd67d"
|
"uuid": "a8984692-a820-45de-8d4d-fc006b29072a"
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
from ..web.route import Route
|
from ..web.route import Route
|
||||||
from ..schemas.project import PROJECT_OBJECT_SCHEMA
|
from ..schemas.project import PROJECT_OBJECT_SCHEMA
|
||||||
from ..modules.project import Project
|
from ..modules.project_manager import ProjectManager
|
||||||
from aiohttp.web import HTTPConflict
|
from aiohttp.web import HTTPConflict
|
||||||
|
|
||||||
|
|
||||||
@ -29,6 +29,9 @@ class ProjectHandler:
|
|||||||
output=PROJECT_OBJECT_SCHEMA,
|
output=PROJECT_OBJECT_SCHEMA,
|
||||||
input=PROJECT_OBJECT_SCHEMA)
|
input=PROJECT_OBJECT_SCHEMA)
|
||||||
def create_project(request, response):
|
def create_project(request, response):
|
||||||
p = Project(location = request.json.get("location"),
|
pm = ProjectManager.instance()
|
||||||
uuid = request.json.get("uuid"))
|
p = pm.create_project(
|
||||||
|
location = request.json.get("location"),
|
||||||
|
uuid = request.json.get("uuid")
|
||||||
|
)
|
||||||
response.json(p)
|
response.json(p)
|
||||||
|
Loading…
Reference in New Issue
Block a user