Unverified Commit 9f463b6f authored by mvdbeek's avatar mvdbeek
Browse files

Adapt scripts/resumable_upload.py to fetch API

Finding out that the `files` parameter is required took way more time
than I want to admit ... .
parent e0f4b86a
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -292,8 +292,10 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Description:
    Maximum size of uploadable files in gigabytes.
:Default: ``100``
    Maximum size of uploadable files, specified in bytes (default:
    100GB). This value is ignored if an external upload server is
    configured.
:Default: ``107374182400``
:Type: int


@@ -2337,8 +2339,8 @@
:Description:
    Galaxy can upload user files in chunks without using nginx. Enable
    the chunk uploader by specifying a chunk size larger than 0. The
    chunk size is specified in bytes (default: 100MB).
:Default: ``104857600``
    chunk size is specified in bytes (default: 10MB).
:Default: ``10485760``
:Type: int


+6 −4
Original line number Diff line number Diff line
@@ -242,8 +242,10 @@ galaxy:
  # <data_dir>.
  #new_file_path: tmp

  # Maximum size of uploadable files in gigabytes.
  #maximum_upload_file_size: 100
  # Maximum size of uploadable files, specified in bytes (default:
  # 100GB). This value is ignored if an external upload server is
  # configured.
  #maximum_upload_file_size: 107374182400

  # Tool config files, defines what tools are available in Galaxy. Tools
  # can be locally developed or installed from Galaxy tool sheds.
@@ -1185,8 +1187,8 @@ galaxy:

  # Galaxy can upload user files in chunks without using nginx. Enable
  # the chunk uploader by specifying a chunk size larger than 0. The
  # chunk size is specified in bytes (default: 100MB).
  #chunk_upload_size: 104857600
  # chunk size is specified in bytes (default: 10MB).
  #chunk_upload_size: 10485760

  # Have Galaxy manage dynamic proxy component for routing requests to
  # other services based on Galaxy's session cookie.  It will attempt to
+1 −1
Original line number Diff line number Diff line
@@ -1402,7 +1402,7 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
    app = wrap_if_allowed(app, stack, TusMiddleware, kwargs={
        'upload_path': '/api/upload/resumable_upload',
        'tmp_dir': application_stack.config.new_file_path,
        'max_size': application_stack.config.maximum_upload_file_size * 1024 ** 3
        'max_size': application_stack.config.maximum_upload_file_size
    })
    # api batch call processing middleware
    app = wrap_if_allowed(app, stack, BatchMiddleware, args=(webapp, {}))
+3 −2
Original line number Diff line number Diff line
@@ -227,10 +227,11 @@ mapping:

      maximum_upload_file_size:
        type: int
        default: 100
        default: 107374182400
        required: false
        desc: |
          Maximum size of uploadable files in gigabytes.
          Maximum size of uploadable files, specified in bytes (default: 100GB).
          This value is ignored if an external upload server is configured.

      tool_config_file:
        type: any
+1 −1
Original line number Diff line number Diff line
@@ -926,7 +926,7 @@ class ToolsUploadTestCase(ApiTestCase):

        with self.dataset_populator.test_history() as history_id:
            session_id = upload_file(url=f"{self.url}/api/upload/resumable_upload", path=TestDataResolver().get_filename("1.fastqsanger.gz"), api_key=self.galaxy_interactor.api_key, history_id=history_id)
            hda = self._upload_and_get_details(content=json.dumps({'session_id': session_id, 'name': '1.fastqsanger.gz'}), api='fetch', ext='fastqsanger.gz')
            hda = self._upload_and_get_details(content=json.dumps({'session_id': session_id}), api='fetch', ext='fastqsanger.gz', name='1.fastqsanger.gz')
            assert hda['name'] == '1.fastqsanger.gz'
            assert hda['file_ext'] == 'fastqsanger.gz'
            assert hda['state'] == 'ok'
Loading