Actions
Issue #4896
closed[Ruby client] Chunked Uploads API doesn't recognize file parameter
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
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
Actions
Problem: OpenAPI schema for Uploads APIs is wrong
Solution: Add Content-Range header to the OpenAPI schema
Required PR: https://github.com/pulp/pulp-openapi-generator/pull/17
fixes: #4896 https://pulp.plan.io/issues/4896