mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Use project_id instead of project_uuid for the API.
This commit is contained in:
1 parent
d2699f051d
commit
59c82e26df
8 files changed
+30
-30
No files matched your search
@@ -42,23 +42,23 @@ class ProjectManager:
|
||||
cls._instance = cls()
|
||||
return cls._instance
|
||||
|
||||
def get_project(self, project_uuid):
|
||||
def get_project(self, uuid):
|
||||
"""
|
||||
Returns a Project instance.
|
||||
|
||||
:param project_uuid: Project UUID
|
||||
:param uuid: Project UUID
|
||||
|
||||
:returns: Project instance
|
||||
"""
|
||||
|
||||
try:
|
||||
UUID(project_uuid, version=4)
|
||||
UUID(uuid, version=4)
|
||||
except ValueError:
|
||||
raise aiohttp.web.HTTPBadRequest(text="{} is not a valid UUID".format(project_uuid))
|
||||
raise aiohttp.web.HTTPBadRequest(text="{} is not a valid UUID".format(uuid))
|
||||
|
||||
if project_uuid not in self._projects:
|
||||
raise aiohttp.web.HTTPNotFound(text="Project UUID {} doesn't exist".format(project_uuid))
|
||||
return self._projects[project_uuid]
|
||||
if uuid not in self._projects:
|
||||
raise aiohttp.web.HTTPNotFound(text="Project UUID {} doesn't exist".format(uuid))
|
||||
return self._projects[uuid]
|
||||
|
||||
def create_project(self, **kwargs):
|
||||
"""
|
||||
|
||||
@@ -79,7 +79,7 @@ class VirtualBoxVM(BaseVM):
|
||||
return {"name": self.name,
|
||||
"uuid": self.uuid,
|
||||
"console": self.console,
|
||||
"project_uuid": self.project.uuid,
|
||||
"project_id": self.project.uuid,
|
||||
"vmname": self.vmname,
|
||||
"headless": self.headless,
|
||||
"enable_remote_console": self.enable_remote_console,
|
||||
|
||||
@@ -107,7 +107,7 @@ class VPCSVM(BaseVM):
|
||||
return {"name": self.name,
|
||||
"uuid": self.uuid,
|
||||
"console": self._console,
|
||||
"project_uuid": self.project.uuid,
|
||||
"project_id": self.project.uuid,
|
||||
"script_file": self.script_file,
|
||||
"startup_script": self.startup_script}
|
||||
|
||||
|
||||
Reference in new issue
Block a user