2023-04-19 07:34:40 +00:00
|
|
|
class Machine:
|
2023-04-19 10:01:53 +00:00
|
|
|
def __init__(self, name, image_name, start_time, ipvpn, iplocal, username, password):
|
2023-04-19 07:34:40 +00:00
|
|
|
self.name = name
|
|
|
|
self.image_name = image_name
|
|
|
|
self.start_time = start_time
|
2023-04-19 10:01:53 +00:00
|
|
|
self.ipvpn = ipvpn
|
|
|
|
self.iplocal = iplocal
|
2023-04-19 07:34:40 +00:00
|
|
|
self.username = username
|
|
|
|
self.password = password
|
|
|
|
class MachineManager:
|
|
|
|
def __init__(self):
|
|
|
|
self.machines = []
|
|
|
|
|
|
|
|
def add_machine(self, machine):
|
|
|
|
self.machines.append(machine)
|
|
|
|
|
|
|
|
def remove_machine(self, machine):
|
|
|
|
self.machines.remove(machine)
|
|
|
|
|
|
|
|
def get_machine_by_name(self, name):
|
|
|
|
for machine in self.machines:
|
|
|
|
if machine.name == name:
|
|
|
|
return machine
|
|
|
|
return None
|