Skip to content

Commit

Permalink
Add extract output files
Browse files Browse the repository at this point in the history
  • Loading branch information
vinulw committed Dec 3, 2024
1 parent 20e7164 commit 67dffe5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/server/oasisapi/analyses/v2_api/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,7 @@ def list_input_files(self, request, pk=None, version=None):
def extract_input_file(self, request, pk=None, version=None):
"""
get:
Gets the portfolios `input_file` contents
delete:
Disassociates the portfolios `input_file` contents
Extract and get `input_file` content.
"""
return handle_get_related_file_tar(self.get_object(), 'input_file', request, ['application/x-gzip', 'application/gzip', 'application/x-tar', 'application/tar'])

Expand Down Expand Up @@ -538,6 +535,15 @@ def list_output_files(self, request, pk=None, version=None):
"""
return handle_get_related_file_tar(self.get_object(), 'output_file', request, ['application/x-gzip', 'application/gzip', 'application/x-tar', 'application/tar'])

@swagger_auto_schema(methods=['get'], responses={200: FILE_RESPONSE}, manual_parameters=[FILENAME_PARAM])
@action(methods=['get'], detail=True)
def extract_output_file(self, request, pk=None, version=None):
"""
get:
Extract and get `output_file` content.
"""
return handle_get_related_file_tar(self.get_object(), 'output_file', request, ['application/x-gzip', 'application/gzip', 'application/x-tar', 'application/tar'])

@requires_sql_reader
@swagger_auto_schema(methods=['get'], responses={200: NestedRelatedFileSerializer})
@action(methods=['get'], detail=True)
Expand Down

0 comments on commit 67dffe5

Please sign in to comment.