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

feat: job provider list endpoint #1583

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

paaragon
Copy link
Collaborator

Summary

This PR creates a new endpoint to allow providers to retrieve all jobs from a function they own.

Details and comments

The endpoint support pagination and jobs are returned without results

@paaragon paaragon requested a review from Tansito February 11, 2025 10:30
@@ -32,6 +33,20 @@ def get_job_by_id(self, job_id: str) -> Job:

return result_queryset

def get_program_jobs(self, program: Program, ordering="-created") -> List[Job]:
Copy link
Member

Choose a reason for hiding this comment

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

Remember that we decided to start using function instead of program in our code for all the new stuff to try to use the new nomenclature. So let's rename this method to get_jobs_from_function or something like that, @paaragon

@@ -145,6 +154,65 @@ def list(self, request):
serializer = self.get_serializer_job_without_result(queryset, many=True)
return Response(serializer.data)

@action(methods=["GET"], detail=False, url_path="provider")
def provider_list(self, request):
Copy link
Member

Choose a reason for hiding this comment

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

Remember @paaragon that you need to include this new end-point in the v1 too:
https://github.com/Qiskit/qiskit-serverless/blob/main/gateway/api/v1/views/jobs.py

Add to it the swagger configuration also.

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