Island: Implement AgentSignals resource's GET

This commit is contained in:
Shreya Malviya 2022-09-23 13:52:43 +05:30 committed by Mike Salvatore
parent cfe31f8dee
commit cca4cf9df2
1 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,7 @@ from flask import request
from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic
from monkey_island.cc.resources.AbstractResource import AbstractResource
from monkey_island.cc.services import AgentSignalsService
logger = logging.getLogger(__name__)
@ -16,8 +17,10 @@ class AgentSignals(AbstractResource):
def __init__(
self,
island_event_queue: IIslandEventQueue,
agent_signals_service: AgentSignalsService,
):
self._island_event_queue = island_event_queue
self._agent_signals_service = agent_signals_service
def post(self):
try:
@ -35,5 +38,5 @@ class AgentSignals(AbstractResource):
return {}, HTTPStatus.NO_CONTENT
def get(self, agent_id: str):
# TODO: return AgentSignals
return {}, HTTPStatus.OK
agent_signals = self._agent_signals_service.get_signals(agent_id)
return agent_signals.dict(), HTTPStatus.OK