forked from p15670423/monkey
Island: Change method order in RemoteRun
This commit is contained in:
parent
ae0e8ddb8e
commit
f83832dc3c
|
@ -23,12 +23,6 @@ class RemoteRun(flask_restful.Resource):
|
||||||
def __init__(self, aws_service: AWSService):
|
def __init__(self, aws_service: AWSService):
|
||||||
self._aws_service = aws_service
|
self._aws_service = aws_service
|
||||||
|
|
||||||
def run_aws_monkeys(self, request_body) -> Sequence[AWSCommandResults]:
|
|
||||||
instances = request_body.get("instances")
|
|
||||||
island_ip = request_body.get("island_ip")
|
|
||||||
|
|
||||||
return self._aws_service.run_agents_on_managed_instances(instances, island_ip)
|
|
||||||
|
|
||||||
@jwt_required
|
@jwt_required
|
||||||
def get(self):
|
def get(self):
|
||||||
action = request.args.get("action")
|
action = request.args.get("action")
|
||||||
|
@ -58,6 +52,12 @@ class RemoteRun(flask_restful.Resource):
|
||||||
# default action
|
# default action
|
||||||
return make_response({"error": "Invalid action"}, 500)
|
return make_response({"error": "Invalid action"}, 500)
|
||||||
|
|
||||||
|
def run_aws_monkeys(self, request_body) -> Sequence[AWSCommandResults]:
|
||||||
|
instances = request_body.get("instances")
|
||||||
|
island_ip = request_body.get("island_ip")
|
||||||
|
|
||||||
|
return self._aws_service.run_agents_on_managed_instances(instances, island_ip)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _encode_results(results: Sequence[AWSCommandResults]):
|
def _encode_results(results: Sequence[AWSCommandResults]):
|
||||||
result = list(map(RemoteRun._aws_command_results_to_encodable_dict, results))
|
result = list(map(RemoteRun._aws_command_results_to_encodable_dict, results))
|
||||||
|
|
Loading…
Reference in New Issue