Island: Add init and IAgentConfigurationRepository dependency to Telemetry resource

This commit is contained in:
Shreya Malviya 2022-07-14 14:14:33 +05:30
parent b237d258e5
commit 093e6fa3a6
1 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@ from flask import request
from monkey_island.cc.database import mongo
from monkey_island.cc.models.monkey import Monkey
from monkey_island.cc.models.telemetries import get_telemetry_by_query
from monkey_island.cc.repository import IAgentConfigurationRepository
from monkey_island.cc.resources.AbstractResource import AbstractResource
from monkey_island.cc.resources.request_authentication import jwt_required
from monkey_island.cc.services.node import NodeService
@ -20,6 +21,9 @@ class Telemetry(AbstractResource):
# API Spec: Resource name should be plural
urls = ["/api/telemetry", "/api/telemetry/<string:monkey_guid>"]
def __init__(self, agent_configuration_repository: IAgentConfigurationRepository):
self._agent_configuration_repository = agent_configuration_repository
@jwt_required
def get(self, **kw):
monkey_guid = request.args.get("monkey_guid")