Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to allow 2 new modes for ostree object upload #70

Merged
merged 1 commit into from
Feb 4, 2019

Conversation

simao
Copy link
Contributor

@simao simao commented Jan 23, 2019

This PR adds two new modes of operation on the POST/objects/:object-id endpoint, while leaving the current api untouched: Stream Upload and Out of Band Upload.

Stream upload

When POSTing bytes using a properly set Content-Length header and Content-Type: application/octet-stream the server will be able to stream the request from the client upstream to amazon s3 or file system without first copying the file to a temporary location.

This should be a simple change on the client and this is equivalent to using the curl command: curl -H 'application/octet-stream' --data-binary @myfile.bin host:/api/v2/objects/:object-id

Out of band upload

This is enabled when using s3 storage only, if the client supplies a 'x-ats-accept-redirect: true header and a size=<object size> URL parameter, the server will reply with a redirect response, redirecting the client to an amazon s3 URL the client can use to upload the file using a PUT request and the same curl options as above.

The server will archive the object after an hour (default value) if the client does not upload the object or report it as uploaded with a PUT request to PUT /objects/:object-id

If out of band upload is not enabled on the server, but the client is anyway uploading the object using --data-binary, setting x-ats-accept-redirect and size, the server will accept the object
and stream it local storage.

adds two new modes of operation on the `POST /objects/:object-id`
endpoint, while leaving the current api untouched: Stream Upload and
Out of Band Upload.

Signed-off-by: Simão Mata <simao.mata@here.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants