mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Initial config path for IOU
This commit is contained in:
1 parent
dd1833c4f0
commit
03b6563864
4 files changed
+17
-10
No files matched your search
@@ -62,7 +62,7 @@ class IOUHandler:
|
||||
ram=request.json.get("ram"),
|
||||
nvram=request.json.get("nvram"),
|
||||
l1_keepalives=request.json.get("l1_keepalives"),
|
||||
initial_config=request.json.get("initial_config")
|
||||
initial_config=request.json.get("initial_config_content")
|
||||
)
|
||||
vm.path = request.json.get("path", vm.path)
|
||||
response.set_status(201)
|
||||
@@ -116,7 +116,7 @@ class IOUHandler:
|
||||
vm.ram = request.json.get("ram", vm.ram)
|
||||
vm.nvram = request.json.get("nvram", vm.nvram)
|
||||
vm.l1_keepalives = request.json.get("l1_keepalives", vm.l1_keepalives)
|
||||
vm.initial_config = request.json.get("initial_config", vm.initial_config)
|
||||
vm.initial_config = request.json.get("initial_config_content", vm.initial_config)
|
||||
|
||||
response.json(vm)
|
||||
|
||||
|
||||
@@ -200,6 +200,7 @@ class IOUVM(BaseVM):
|
||||
"ram": self._ram,
|
||||
"nvram": self._nvram,
|
||||
"l1_keepalives": self._l1_keepalives,
|
||||
"initial_config": self.relative_initial_config_file
|
||||
}
|
||||
|
||||
@property
|
||||
@@ -890,7 +891,7 @@ class IOUVM(BaseVM):
|
||||
|
||||
path = os.path.join(self.working_dir, 'initial-config.cfg')
|
||||
if os.path.exists(path):
|
||||
return path.replace(self.project.path, "")[1:]
|
||||
return 'initial-config.cfg'
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ IOU_CREATE_SCHEMA = {
|
||||
"description": "Always up ethernet interface",
|
||||
"type": ["boolean", "null"]
|
||||
},
|
||||
"initial_config": {
|
||||
"initial_config_content": {
|
||||
"description": "Initial configuration of the IOU",
|
||||
"type": ["string", "null"]
|
||||
}
|
||||
@@ -115,7 +115,7 @@ IOU_UPDATE_SCHEMA = {
|
||||
"description": "Always up ethernet interface",
|
||||
"type": ["boolean", "null"]
|
||||
},
|
||||
"initial_config": {
|
||||
"initial_config_content": {
|
||||
"description": "Initial configuration of the IOU",
|
||||
"type": ["string", "null"]
|
||||
}
|
||||
@@ -177,9 +177,13 @@ IOU_OBJECT_SCHEMA = {
|
||||
"description": "Always up ethernet interface",
|
||||
"type": "boolean"
|
||||
},
|
||||
"initial_config": {
|
||||
"description": "Path of the initial config content relative to project directory",
|
||||
"type": ["string", "null"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": False,
|
||||
"required": ["name", "vm_id", "console", "project_id", "path", "serial_adapters", "ethernet_adapters", "ram", "nvram", "l1_keepalives"]
|
||||
"required": ["name", "vm_id", "console", "project_id", "path", "serial_adapters", "ethernet_adapters", "ram", "nvram", "l1_keepalives", "initial_config"]
|
||||
}
|
||||
|
||||
IOU_NIO_SCHEMA = {
|
||||
|
||||
Reference in new issue
Block a user