Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add runtimejob handling additional apis #1197

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

akihikokuroda
Copy link
Collaborator

Summary

Related to: #1163

Details and comments

Adding runtime job to the job:

/api/v1/jobs/{job id}/add_runtimejob

list the runtime jobs created in the job:

/api/v1/jobs/{job id}/list_runtimejob

job = self.get_object()
runtimejob = RuntimeJob(
job=job,
runtime_job=request.data.get("runtime_job"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check that runtime_job got passed in request somehow to display user friendly error?

Something like

if not request.data.get("runtime_job"):
    return Response({"message": "Got empty `runtime_job` field. Please, specify `runtime_job`."}, code / status=400)

ctx = TraceContextTextMapPropagator().extract(carrier=request.headers)
with tracer.start_as_current_span("gateway.job.stop", context=ctx):
job = self.get_object()
runtimejobs = RuntimeJob.objects.all().filter(job=job)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
runtimejobs = RuntimeJob.objects.all().filter(job=job)
runtimejobs = RuntimeJob.objects.filter(job=job)

@akihikokuroda
Copy link
Collaborator Author

@IceKhan13 Thanks for review. I updated both places.

Copy link
Member

@IceKhan13 IceKhan13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @akihikokuroda !

@akihikokuroda akihikokuroda merged commit 3af60ac into Qiskit:main Jan 29, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants