2018-11-01 19:50:04 +01:00
|
|
|
from aiohttp import web
|
|
|
|
from aiojobs.aiohttp import get_scheduler_from_app
|
|
|
|
|
|
|
|
from core.api.decorator import request_mapping
|
|
|
|
|
|
|
|
|
|
|
|
class SystemController():
|
|
|
|
name = "Manuel"
|
|
|
|
|
2018-11-01 21:25:42 +01:00
|
|
|
def __init__(self, cbpi):
|
|
|
|
self.cbpi = cbpi
|
|
|
|
self.service = cbpi.actor
|
|
|
|
self.cbpi.register(self, "/system")
|
2018-11-01 19:50:04 +01:00
|
|
|
|
|
|
|
@request_mapping("/jobs", method="GET", name="get_jobs", auth_required=True)
|
|
|
|
def get_all_jobs(self, request):
|
2018-11-01 21:25:42 +01:00
|
|
|
scheduler = get_scheduler_from_app(self.cbpi.app)
|
2018-11-04 00:47:26 +01:00
|
|
|
|
2018-11-01 19:50:04 +01:00
|
|
|
for j in scheduler:
|
|
|
|
print(j)
|
|
|
|
|
|
|
|
# await j.close()
|
|
|
|
return web.Response(text="HALLO")
|