forked from p15670423/monkey
Island: Implement AgentSignals resource's GET
This commit is contained in:
parent
cfe31f8dee
commit
cca4cf9df2
|
@ -6,6 +6,7 @@ from flask import request
|
||||||
|
|
||||||
from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic
|
from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic
|
||||||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||||
|
from monkey_island.cc.services import AgentSignalsService
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -16,8 +17,10 @@ class AgentSignals(AbstractResource):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
island_event_queue: IIslandEventQueue,
|
island_event_queue: IIslandEventQueue,
|
||||||
|
agent_signals_service: AgentSignalsService,
|
||||||
):
|
):
|
||||||
self._island_event_queue = island_event_queue
|
self._island_event_queue = island_event_queue
|
||||||
|
self._agent_signals_service = agent_signals_service
|
||||||
|
|
||||||
def post(self):
|
def post(self):
|
||||||
try:
|
try:
|
||||||
|
@ -35,5 +38,5 @@ class AgentSignals(AbstractResource):
|
||||||
return {}, HTTPStatus.NO_CONTENT
|
return {}, HTTPStatus.NO_CONTENT
|
||||||
|
|
||||||
def get(self, agent_id: str):
|
def get(self, agent_id: str):
|
||||||
# TODO: return AgentSignals
|
agent_signals = self._agent_signals_service.get_signals(agent_id)
|
||||||
return {}, HTTPStatus.OK
|
return agent_signals.dict(), HTTPStatus.OK
|
||||||
|
|
Loading…
Reference in New Issue