From a3d94d7a493578cacb23bd21cc657af30a83a5aa Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Fri, 23 Sep 2022 13:51:21 +0200 Subject: [PATCH] Agent: Add get_agent_signals to IIslandAPIClient --- .../island_api_client/i_island_api_client.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/island_api_client/i_island_api_client.py b/monkey/infection_monkey/island_api_client/i_island_api_client.py index 8ecd98b49..025261e06 100644 --- a/monkey/infection_monkey/island_api_client/i_island_api_client.py +++ b/monkey/infection_monkey/island_api_client/i_island_api_client.py @@ -1,5 +1,6 @@ from abc import ABC, abstractmethod -from typing import Sequence +from datetime import datetime +from typing import Optional, Sequence from common import AgentRegistrationData, OperatingSystem from common.agent_configuration import AgentConfiguration @@ -143,3 +144,15 @@ class IIslandAPIClient(ABC): :raises IslandAPITimeoutError: If the command timed out :return: Credentials """ + + @abstractmethod + def get_agent_signals(self, agent_id: str) -> Optional[datetime]: + """ + Get agent signals from the island + + :raises IslandAPIConnectionError: If the client could not connect to the island + :raises IslandAPIRequestError: If there was a problem with the client request + :raises IslandAPIRequestFailedError: If the server experienced an error + :raises IslandAPITimeoutError: If the command timed out + :return: Terminate datetime + """