From aa3c6c2f4dfa10cce4e24d366657cf4b430cab50 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 19 Sep 2022 19:47:14 -0400 Subject: [PATCH] Agent: Add IIslandAPIClient.get_pba_file() --- .../island_api_client/i_island_api_client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 2db9ab239..8479f39ec 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 @@ -30,3 +30,17 @@ class IIslandAPIClient(ABC): :raises IslandAPIError: If an unexpected error occurred while attempting to send the contents of the agent's log to the island """ + + @abstractmethod + def get_pba_file(self, filename: str) -> bytes: + """ + Get a custom PBA file from the island + + :param filename: The name of the custom PBA file + :return: The contents of the custom PBA file in bytes + :raises IslandAPIConnectionError: If a connection cannot be made to the island + :raises IslandAPITimeoutError: If a timeout occurs while attempting to connect to the island + or retrieve the custom PBA file + :raises IslandAPIError: If an unexpected error occurred while attempting to retrieve the + custom PBA file + """