From: Michael Tremer Date: Wed, 1 Nov 2023 10:07:44 +0000 (+0000) Subject: jobs: Update API X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81b92d19dd0ad8b4595ce042347b4c1754ac1ff6;p=pbs.git jobs: Update API Signed-off-by: Michael Tremer --- diff --git a/src/web/__init__.py b/src/web/__init__.py index 1abe4d19..f8cfef69 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -181,8 +181,7 @@ class Application(tornado.web.Application): (r"/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/retry", jobs.RetryHandler), (r"/api/v1/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", jobs.APIv1ControlHandler), - (r"/api/v1/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/finished", - jobs.APIv1FinishedHandler), + (r"/api/v1/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", jobs.APIv1IndexHandler), (r"/api/v1/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/log/stream", jobs.APIv1LogStreamHandler), diff --git a/src/web/jobs.py b/src/web/jobs.py index 598c366b..4396d1ee 100644 --- a/src/web/jobs.py +++ b/src/web/jobs.py @@ -66,8 +66,8 @@ class APIv1ControlHandler(base.APIMixin, tornado.websocket.WebSocketHandler): await self.logstream.message(timestamp, level, message) -class APIv1FinishedHandler(base.APIMixin, tornado.web.RequestHandler): - @tornado.web.authenticated +class APIv1IndexHandler(base.APIMixin, tornado.web.RequestHandler): + @base.negotiate async def post(self, uuid): job = self.backend.jobs.get_by_uuid(uuid) if not job: @@ -99,9 +99,7 @@ class APIv1FinishedHandler(base.APIMixin, tornado.web.RequestHandler): self.backend.run_task(self.backend.builds.launch, builds) # Send something back to the builder - self.finish({ - "status" : "ok", - }) + self.finish({}) class APIv1LogStreamHandler(base.BackendMixin, tornado.websocket.WebSocketHandler):