From bbc59b01b03bb7e692c5daedbc690a5c8d5ff1c4 Mon Sep 17 00:00:00 2001 From: Saman Ehsan Date: Mon, 18 Mar 2019 10:01:08 -0400 Subject: [PATCH] Fix payload for adding file references (#128) * Fix file reference payload When adding file references via the ingest API, the payload needs to nest the file schema under a "content" key. * Update docker version for testing * Update logging * Update docker image versions --- adapter_pipelines/Optimus/adapter.wdl | 2 +- adapter_pipelines/cellranger/adapter.wdl | 2 +- adapter_pipelines/ss2_single_sample/adapter.wdl | 2 +- pipeline_tools/create_envelope.py | 9 +++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/adapter_pipelines/Optimus/adapter.wdl b/adapter_pipelines/Optimus/adapter.wdl index f997b6b8..5433ee2c 100644 --- a/adapter_pipelines/Optimus/adapter.wdl +++ b/adapter_pipelines/Optimus/adapter.wdl @@ -139,7 +139,7 @@ workflow AdapterOptimus { Int max_cromwell_retries = 0 Boolean add_md5s = false - String pipeline_tools_version = "v0.48.0" + String pipeline_tools_version = "v0.48.1" call GetInputs as prep { input: diff --git a/adapter_pipelines/cellranger/adapter.wdl b/adapter_pipelines/cellranger/adapter.wdl index 50287dd6..c0d9d042 100644 --- a/adapter_pipelines/cellranger/adapter.wdl +++ b/adapter_pipelines/cellranger/adapter.wdl @@ -150,7 +150,7 @@ workflow Adapter10xCount { Int max_cromwell_retries = 0 Boolean add_md5s = false - String pipeline_tools_version = "v0.48.0" + String pipeline_tools_version = "v0.48.1" call GetInputs { input: diff --git a/adapter_pipelines/ss2_single_sample/adapter.wdl b/adapter_pipelines/ss2_single_sample/adapter.wdl index ae1d493d..04f3bea3 100644 --- a/adapter_pipelines/ss2_single_sample/adapter.wdl +++ b/adapter_pipelines/ss2_single_sample/adapter.wdl @@ -82,7 +82,7 @@ workflow AdapterSmartSeq2SingleCell{ Int max_cromwell_retries = 0 Boolean add_md5s = false - String pipeline_tools_version = "v0.48.0" + String pipeline_tools_version = "v0.48.1" call GetInputs as prep { input: diff --git a/pipeline_tools/create_envelope.py b/pipeline_tools/create_envelope.py index 53fb8aa5..1348e419 100644 --- a/pipeline_tools/create_envelope.py +++ b/pipeline_tools/create_envelope.py @@ -312,8 +312,13 @@ def add_file_reference(file_ref, file_refs_url, auth_headers, http_requests): Raises: requests.HTTPError: For 4xx errors or 5xx errors beyond timeout. """ - print('Adding file: {0} to the file reference.'.format(file_ref['file_core']['file_name'])) - response = http_requests.put(file_refs_url, headers=auth_headers, json=file_ref) + # Format payload for ingest file reference API endpoint + file_payload = { + 'fileName': file_ref['file_core']['file_name'], + 'content': file_ref + } + print('Adding file reference: {}'.format(file_payload)) + response = http_requests.put(file_refs_url, headers=auth_headers, json=file_payload) return response.json()