sp-hydra-veil-core/core/controllers/SystemStateController.py

29 lines
767 B
Python

from core.models.system.SystemState import SystemState
class SystemStateController:
@staticmethod
def get():
return SystemState.get()
@staticmethod
def exists():
return SystemState.exists()
@staticmethod
def create(profile_id: int, firewalled: bool, dns_set: bool, process_id: int = None) -> SystemState:
if process_id:
current_state = SystemState(profile_id, firewalled, dns_set, process_id)
else:
current_state = SystemState(profile_id, firewalled, dns_set)
current_state.save()
return current_state
@staticmethod
def update_or_create(system_state):
system_state.save()
@staticmethod
def dissolve():
return SystemState.dissolve()