mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Return what is supported by a compute node
Ref https://github.com/GNS3/gns3-gui/issues/1448
This commit is contained in:
15 files changed
+210
-68
No files matched your search
@@ -58,6 +58,14 @@ class BaseManager:
|
||||
self._port_manager = None
|
||||
self._config = Config.instance()
|
||||
|
||||
@classmethod
|
||||
def node_types(cls):
|
||||
"""
|
||||
:returns: Array of supported node type on this computer
|
||||
"""
|
||||
# By default we transform DockerVM => docker but you can override this (see builtins)
|
||||
return [cls._NODE_CLASS.__name__.rstrip('VM').lower()]
|
||||
|
||||
@property
|
||||
def nodes(self):
|
||||
"""
|
||||
|
||||
@@ -34,3 +34,10 @@ class Builtin(BaseManager):
|
||||
def __init__(self):
|
||||
|
||||
super().__init__()
|
||||
|
||||
@classmethod
|
||||
def node_types(cls):
|
||||
"""
|
||||
:returns: List of node type supported by this class and computer
|
||||
"""
|
||||
return ['cloud', 'nat', 'ethernet_hub', 'ethernet_switch']
|
||||
@@ -116,6 +116,13 @@ class Dynamips(BaseManager):
|
||||
self._dynamips_path = None
|
||||
self._dynamips_ids = {}
|
||||
|
||||
@classmethod
|
||||
def node_types(cls):
|
||||
"""
|
||||
:returns: List of node type supported by this class and computer
|
||||
"""
|
||||
return ['dynamips', 'frame_relay_switch', 'atm_switch']
|
||||
|
||||
def get_dynamips_id(self, project_id):
|
||||
"""
|
||||
:param project_id: UUID of the project
|
||||
|
||||
Reference in new issue
Block a user