diff --git a/monkey/monkey_island/cc/repository/i_agent_repository.py b/monkey/monkey_island/cc/repository/i_agent_repository.py index 619738ab5..b56745222 100644 --- a/monkey/monkey_island/cc/repository/i_agent_repository.py +++ b/monkey/monkey_island/cc/repository/i_agent_repository.py @@ -19,6 +19,15 @@ class IAgentRepository(ABC): :raises StorageError: If an error occurs while attempting to store the `Agent` """ + @abstractmethod + def get_agents(self) -> Sequence[Agent]: + """ + Get all `Agents` stored in the repository + + :return: All agents in the repository + :raises RetrievalError: If an error occurs while attempting to retrieve the `Agents` + """ + @abstractmethod def get_agent_by_id(self, agent_id: AgentID) -> Agent: """ diff --git a/monkey/monkey_island/cc/repository/mongo_agent_repository.py b/monkey/monkey_island/cc/repository/mongo_agent_repository.py index 021cf34bc..70aa0a2ed 100644 --- a/monkey/monkey_island/cc/repository/mongo_agent_repository.py +++ b/monkey/monkey_island/cc/repository/mongo_agent_repository.py @@ -38,6 +38,9 @@ class MongoAgentRepository(IAgentRepository): f"but no agents were inserted" ) + def get_agents(self) -> Sequence[Agent]: + return [] + def get_agent_by_id(self, agent_id: AgentID) -> Agent: try: agent_dict = self._agents_collection.find_one(