forked from p15670423/monkey
Island: Publish RESET_AGENT_CONFIGURATION from endpoint
This commit is contained in:
parent
f9b1c5ebd2
commit
b834bfe7f7
|
@ -2,22 +2,22 @@ from http import HTTPStatus
|
||||||
|
|
||||||
from flask import make_response
|
from flask import make_response
|
||||||
|
|
||||||
|
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.resources.request_authentication import jwt_required
|
from monkey_island.cc.resources.request_authentication import jwt_required
|
||||||
from monkey_island.cc.services import RepositoryService
|
|
||||||
|
|
||||||
|
|
||||||
class ResetAgentConfiguration(AbstractResource):
|
class ResetAgentConfiguration(AbstractResource):
|
||||||
urls = ["/api/reset-agent-configuration"]
|
urls = ["/api/reset-agent-configuration"]
|
||||||
|
|
||||||
def __init__(self, repository_service: RepositoryService):
|
def __init__(self, event_queue: IIslandEventQueue):
|
||||||
self._repository_service = repository_service
|
self._event_queue = event_queue
|
||||||
|
|
||||||
@jwt_required
|
@jwt_required
|
||||||
def post(self):
|
def post(self):
|
||||||
"""
|
"""
|
||||||
Reset the agent configuration to its default values
|
Reset the agent configuration to its default values
|
||||||
"""
|
"""
|
||||||
self._repository_service.reset_agent_configuration()
|
self._event_queue.publish(IslandEventTopic.RESET_AGENT_CONFIGURATION)
|
||||||
|
|
||||||
return make_response({}, HTTPStatus.OK)
|
return make_response({}, HTTPStatus.OK)
|
||||||
|
|
Loading…
Reference in New Issue