Project

Profile

Help

Issue #4896

closed

[Ruby client] Chunked Uploads API doesn't recognize file parameter

Added by sajha almost 5 years ago. Updated almost 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 56
Quarter:

Description

The Pulpcore API client has the UploadsAPI method uploads_create

For the below inputs:

file = File.new("/path/to/file")
file_chunk_string = "Random String chunk"

The calls below produce the following requests:

pulp3_api.uploads_create(file)

HTTP Request formed:
2019-05-31T02:18:09 [D|kat|] Calling API: UploadsApi.uploads_create ...
2019-05-31T02:18:09 [D|kat|] HTTP request body param ~BEGIN~
 | {"file"=>#<File:/home/vagrant/katello/Gemfile>}
 | ~END~

pulp3_api.uploads_create(file_chunk_string)

HTTP Request formed:
2019-05-31T02:18:09 [D|kat|] Calling API: UploadsApi.uploads_create ...
2019-05-31T02:18:09 [D|kat|] HTTP request body param ~BEGIN~
 | {"file"=>"Random String chunk"}
 | ~END~

In both cases, server returns:

PulpcoreClient::ApiError (Error message: the server returns an error)
HTTP status code: 400
Response headers: {"Server"=>"nginx/1.12.1", "Date"=>"Fri, 31 May 2019 02:18:10 GMT", "Content-Type"=>"application/json", "Content-Length"=>"40", "Connection"=>"keep-alive", "Vary"=>"Accept, Cookie", "Allow"=>"GET, POST, PUT, HEAD, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN"}
Response body: {"detail":"No chunk file was submitted"}

PS:

The UploadsAPI has another method uploads_create_and_check which works with file (file = File.new("/path/to/file")) as an input.


Related issues

Related to Pulp - Story #4196: As a user, I can upload files in chunks.CLOSED - CURRENTRELEASEdaviddavis

Actions
Related to Pulp - Test #4197: Test upload of large artifactsCLOSED - WONTFIXkersomActions

Also available in: Atom PDF