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

Download end point refactor #1547

Merged
merged 11 commits into from
Dec 13, 2024
Prev Previous commit
Next Next commit
include swagger documentation updated
Tansito committed Dec 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 0f18b2fadcb60c7dbf0a8245d9e27eaae23a185a
43 changes: 40 additions & 3 deletions gateway/api/v1/views/files.py
Original file line number Diff line number Diff line change
@@ -64,19 +64,26 @@ def provider_list(self, request):
return super().provider_list(request)

@swagger_auto_schema(
operation_description="Download a specific file",
operation_description="Download a specific file in the user directory",
manual_parameters=[
openapi.Parameter(
"file",
openapi.IN_QUERY,
description="file name",
description="File name",
type=openapi.TYPE_STRING,
required=True,
),
openapi.Parameter(
"function",
openapi.IN_QUERY,
description="Qiskit Function title",
type=openapi.TYPE_STRING,
required=True,
),
openapi.Parameter(
"provider",
openapi.IN_QUERY,
description="provider name",
description="Provider name",
type=openapi.TYPE_STRING,
required=False,
),
@@ -86,6 +93,36 @@ def provider_list(self, request):
def download(self, request):
return super().download(request)

@swagger_auto_schema(
operation_description="Download a specific file in the provider directory",
manual_parameters=[
openapi.Parameter(
"file",
openapi.IN_QUERY,
description="File name",
type=openapi.TYPE_STRING,
required=True,
),
openapi.Parameter(
"function",
openapi.IN_QUERY,
description="Qiskit Function title",
type=openapi.TYPE_STRING,
required=True,
),
openapi.Parameter(
"provider",
openapi.IN_QUERY,
description="Provider name",
type=openapi.TYPE_STRING,
required=True,
),
],
)
@action(methods=["GET"], detail=False, url_path="provider/download")
def provider_download(self, request):
return super().provider_download(request)

@swagger_auto_schema(
operation_description="Deletes file uploaded or produced by the programs",
request_body=openapi.Schema(