mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Merge branch '2.1' into 2.2
# Conflicts: # gns3server/version.py # requirements.txt
This commit is contained in:
commit
d1ccf3bc84
24 files changed
+549
-46
No files matched your search
@@ -60,7 +60,8 @@ class DockerHandler:
|
||||
console_resolution=request.json.get("console_resolution", "1024x768"),
|
||||
console_http_port=request.json.get("console_http_port", 80),
|
||||
console_http_path=request.json.get("console_http_path", "/"),
|
||||
aux=request.json.get("aux"))
|
||||
aux=request.json.get("aux"),
|
||||
extra_hosts=request.json.get("extra_hosts"))
|
||||
for name, value in request.json.items():
|
||||
if name != "node_id":
|
||||
if hasattr(container, name) and getattr(container, name) != value:
|
||||
@@ -312,7 +313,7 @@ class DockerHandler:
|
||||
props = [
|
||||
"name", "console", "aux", "console_type", "console_resolution",
|
||||
"console_http_port", "console_http_path", "start_command",
|
||||
"environment", "adapters"
|
||||
"environment", "adapters", "extra_hosts"
|
||||
]
|
||||
|
||||
changed = False
|
||||
|
||||
@@ -73,11 +73,31 @@ class ProjectHandler:
|
||||
p = pm.create_project(
|
||||
name=request.json.get("name"),
|
||||
path=request.json.get("path"),
|
||||
project_id=request.json.get("project_id")
|
||||
project_id=request.json.get("project_id"),
|
||||
variables=request.json.get("variables", None)
|
||||
)
|
||||
response.set_status(201)
|
||||
response.json(p)
|
||||
|
||||
@Route.put(
|
||||
r"/projects/{project_id}",
|
||||
description="Update the project on the server",
|
||||
status_codes={
|
||||
201: "Project updated",
|
||||
403: "Forbidden to update a project"
|
||||
},
|
||||
output=PROJECT_OBJECT_SCHEMA,
|
||||
input=PROJECT_UPDATE_SCHEMA)
|
||||
def update_project(request, response):
|
||||
|
||||
pm = ProjectManager.instance()
|
||||
project = pm.get_project(request.match_info["project_id"])
|
||||
yield from project.update(
|
||||
variables=request.json.get("variables", None)
|
||||
)
|
||||
response.set_status(200)
|
||||
response.json(project)
|
||||
|
||||
@Route.get(
|
||||
r"/projects/{project_id}",
|
||||
description="Get project information",
|
||||
|
||||
Reference in new issue
Block a user