Beispiel #1
0
    async def get_enodo_labels(cls, request):
        """Return enodo labels and last update timestamp

        Args:
            request (Request): aiohttp request

        Returns:
            _type_: _description_
        """
        resp = BaseHandler.resp_get_enodo_labels()
        return web.json_response(data={'data': resp}, status=200)
Beispiel #2
0
    async def get_settings(cls, request):
        """Returns current settings dict

        Args:
            request (Request): aiohttp request

        Returns:
            _type_: _description_
        """
        resp = BaseHandler.resp_get_enodo_config()
        return web.json_response(data=resp, status=200)
Beispiel #3
0
    async def get_series_config_templates(cls, request):
        """Get all series config templates

        Args:
            request (Request): aiohttp request

        Returns:
            _type_: _description_
        """
        data, status = BaseHandler.resp_get_series_config_templates()
        return web.json_response(data=data, status=status)
Beispiel #4
0
    async def get_siridb_enodo_status(cls, request):
        """Get status of enodo hub

        Args:
            request (Request): aiohttp request

        Returns:
            _type_: _description_
        """
        resp = BaseHandler.resp_get_enodo_hub_status()
        return web.json_response(data=resp, status=200)
Beispiel #5
0
    async def get_possible_analyser_modules(cls, request):
        """Returns list of possible modules with corresponding parameters

        Args:
            request (Request): aiohttp request

        Returns:
            _type_: _description_
        """

        return web.json_response(
            data=BaseHandler.resp_get_possible_analyser_modules(), status=200)
Beispiel #6
0
    async def update_settings(cls, request):
        """Update settings

        Args:
            request (Request): aiohttp request

        Returns:
            _type_: _description_

        JSON POST data:
            key/value pairs settings
        """
        data = await request.json()
        resp = BaseHandler.resp_set_config(data)
        return web.json_response(data=resp, status=200)
Beispiel #7
0
    async def get_monitored_series(cls, request):
        """Returns a list of monitored series

        Args:
            request (Request): aiohttp request

        Returns:
            _type_: _description_

        Query args:
            filter (String): regex filter
        """
        regex_filter = urllib.parse.unquote(
            request.rel_url.query['filter']) \
            if 'filter' in request.rel_url.query else None
        # TODO implement filter

        return web.json_response(
            data=BaseHandler.resp_get_monitored_series(regex_filter),
            dumps=safe_json_dumps)
Beispiel #8
0
 async def get_enodo_labels(cls, sid, data, event):
     return BaseHandler.resp_get_enodo_labels()
Beispiel #9
0
 async def _get_all_series(cls, regex_filter):
     regex_filter = regex_filter if regex_filter else None
     resp = BaseHandler.resp_get_monitored_series(regex_filter)
     return safe_json_dumps(resp)
Beispiel #10
0
 async def get_enodo_settings(cls, sid, data, event):
     resp = BaseHandler.resp_get_enodo_config()
     return resp
Beispiel #11
0
 async def update_enodo_hub_settings(cls, sid, data, event):
     resp = BaseHandler.resp_set_config(data)
     return resp
Beispiel #12
0
 async def get_enodo_hub_status(cls, sid, data, event):
     resp = BaseHandler.resp_get_enodo_hub_status()
     return resp
Beispiel #13
0
 async def subscribe_enodo_modules(cls, sid, data, event):
     if cls._sio is not None:
         cls._sio.enter_room(sid, 'enodo_module_updates')
         return BaseHandler.resp_get_possible_analyser_modules()
Beispiel #14
0
 async def subscribe_queue(cls, sid, data, event=None):
     if cls._sio is not None:
         cls._sio.enter_room(sid, 'job_updates')
     return safe_json_dumps(BaseHandler.resp_get_jobs_queue())
Beispiel #15
0
 async def get_failed_jobs(cls, sid, data, event=None):
     return BaseHandler.resp_get_failed_jobs()
Beispiel #16
0
 async def get_enodo_modules(cls, sid, data, event=None):
     return BaseHandler.resp_get_possible_analyser_modules()