mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-12 20:38:23 +00:00
Add method to delete and update computes
This commit is contained in:
@ -42,9 +42,9 @@ class Compute:
|
||||
assert controller is not None
|
||||
log.info("Create compute %s", compute_id)
|
||||
self._id = compute_id
|
||||
self._protocol = protocol
|
||||
self._host = host
|
||||
self._port = port
|
||||
self.protocol = protocol
|
||||
self.host = host
|
||||
self.port = port
|
||||
self._user = None
|
||||
self._password = None
|
||||
self._connected = False
|
||||
@ -73,6 +73,15 @@ class Compute:
|
||||
else:
|
||||
self._auth = None
|
||||
|
||||
@asyncio.coroutine
|
||||
def update(self, **kwargs):
|
||||
for kw in kwargs:
|
||||
setattr(self, kw, kwargs[kw])
|
||||
if self._session:
|
||||
self._session.close()
|
||||
self._connected = False
|
||||
self._controller.notification.emit("compute.updated", self.__json__())
|
||||
|
||||
@property
|
||||
def version(self):
|
||||
"""
|
||||
@ -117,6 +126,10 @@ class Compute:
|
||||
"""
|
||||
return self._host
|
||||
|
||||
@host.setter
|
||||
def host(self, host):
|
||||
self._host = host
|
||||
|
||||
@property
|
||||
def port(self):
|
||||
"""
|
||||
@ -124,6 +137,10 @@ class Compute:
|
||||
"""
|
||||
return self._port
|
||||
|
||||
@port.setter
|
||||
def port(self, port):
|
||||
self._port = port
|
||||
|
||||
@property
|
||||
def protocol(self):
|
||||
"""
|
||||
@ -131,6 +148,10 @@ class Compute:
|
||||
"""
|
||||
return self._protocol
|
||||
|
||||
@protocol.setter
|
||||
def protocol(self, protocol):
|
||||
self._protocol = protocol
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
return self._user
|
||||
|
Reference in New Issue
Block a user