Skip to content

Commit

Permalink
Fix payload for adding file references (#128)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
samanehsan authored Mar 18, 2019
1 parent 7bbc034 commit bbc59b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion adapter_pipelines/Optimus/adapter.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion adapter_pipelines/cellranger/adapter.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion adapter_pipelines/ss2_single_sample/adapter.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions pipeline_tools/create_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down

0 comments on commit bbc59b0

Please sign in to comment.