Agent: Add get_agent_binary() to the IIslandAPIClient interface

This commit is contained in:
Shreya Malviya 2022-09-20 17:21:31 +05:30
parent d84550ba23
commit 2cebc19843
1 changed files with 18 additions and 0 deletions

View File

@ -1,4 +1,5 @@
from abc import ABC, abstractmethod
from typing import Optional
class IIslandAPIClient(ABC):
@ -54,3 +55,20 @@ class IIslandAPIClient(ABC):
:raises IslandAPIError: If an unexpected error occurs while attempting to retrieve the
custom PBA file
"""
@abstractmethod
def get_agent_binary(self, os_name: str) -> Optional[bytes]:
"""
Get an agent binary for the given OS from the island
:param os_name: The OS on which the agent binary will run
:return: The agent binary file
:raises IslandAPIConnectionError: If the client cannot successfully connect to the island
:raises IslandAPIRequestError: If an error occurs while attempting to connect to the
island due to an issue in the request sent from the client
:raises IslandAPIRequestFailedError: If an error occurs while attempting to connect to the
island due to an error on the server
:raises IslandAPITimeoutError: If a timeout occurs while attempting to connect to the island
:raises IslandAPIError: If an unexpected error occurs while attempting to retrieve the
agent binary
"""