Island: Add preliminary Simulation class

Includes just the island's mode for now.
This commit is contained in:
Mike Salvatore 2022-07-01 08:26:23 -04:00
parent e14101998f
commit 0137c89158
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,21 @@
from __future__ import annotations
from dataclasses import dataclass
from marshmallow import Schema, post_load
from marshmallow_enum import EnumField
from monkey_island.cc.services.mode.mode_enum import IslandModeEnum
@dataclass(frozen=True)
class Simulation:
mode: IslandModeEnum
class SimulationSchema(Schema):
mode = EnumField(IslandModeEnum)
@post_load
def _make_simulation(self, data, **kwargs):
return Simulation(**data)

View File

@ -197,6 +197,9 @@ _make_network_scan_configuration # unused method (monkey/common/configuration/a
_make_propagation_configuration # unused method (monkey/common/configuration/agent_configuration.py:167) _make_propagation_configuration # unused method (monkey/common/configuration/agent_configuration.py:167)
_make_agent_configuration # unused method (monkey/common/configuration/agent_configuration.py:192) _make_agent_configuration # unused method (monkey/common/configuration/agent_configuration.py:192)
# Models
_make_simulation # unused method (monkey/monkey_island/cc/models/simulation.py:19
# TODO DELETE AFTER RESOURCE REFACTORING # TODO DELETE AFTER RESOURCE REFACTORING
NetworkMap NetworkMap