Skip to content

Commit

Permalink
retrieve job_ids
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiko Kuroda <[email protected]>
  • Loading branch information
akihikokuroda committed May 6, 2024
1 parent 0fc4731 commit 6d9e28d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gateway/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ def logs(self, request, pk=None): # pylint: disable=invalid-name,unused-argumen
logs = job.logs
return Response({"logs": logs})

def get_runtime_job(self, job):
return RuntimeJob.objects.filter(job=job)

@action(methods=["POST"], detail=True)
def stop(self, request, pk=None): # pylint: disable=invalid-name,unused-argument
"""Stops job"""
Expand All @@ -426,6 +429,11 @@ def stop(self, request, pk=None): # pylint: disable=invalid-name,unused-argumen
job.status = Job.STOPPED
job.save(update_fields=["status"])
message = "Job has been stopped."
runtime_jobs = self.get_runtime_job(job)
for runtime_job_entry in runtime_jobs:
print(runtime_job_entry.runtime_job)


if job.compute_resource:
if job.compute_resource.active:
job_handler = get_job_handler(job.compute_resource.host)
Expand Down

0 comments on commit 6d9e28d

Please sign in to comment.