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

Options for uploading an existing file #481

Open
soxofaan opened this issue Mar 6, 2023 · 2 comments
Open

Options for uploading an existing file #481

soxofaan opened this issue Mar 6, 2023 · 2 comments
Milestone

Comments

@soxofaan
Copy link
Member

soxofaan commented Mar 6, 2023

spin-off from Open-EO/openeo-python-client#378

openeo-api/openapi.yaml

Lines 3332 to 3337 in 16b1122

put:
summary: Upload a file to the workspace
operationId: upload-file
description: >-
Uploads a new file to the given path or updates an existing file if a
file at the path exists.

Current behavior of uploading a file to an existing path is to silently overwrite the existing file.

We might want to add more options for the user here:

  • blindly overwrite existing files
  • raise error when overwriting existing file
  • skip upload of existing files

The latter could be a client specific feature, but the second option might be important to handle back-end side (doing it client-side might involve race conditions)

@m-mohr
Copy link
Member

m-mohr commented Mar 6, 2023

As you always upload only one file per request, skipping and erroring is basically the same.

In HTTP verbs, I think it's basically just adding a new POST endpoint with very similar semantics.

PUT -> override
POST -> error (i.e. skip) if exists

@soxofaan
Copy link
Member Author

soxofaan commented Mar 7, 2023

Sounds fine do it at API level with standard POST/PUT. Clients can translate that to more user friendly UI (e.g.: error, warning, skip, overwrite, interactive choice, ...).

With POST, would that then be POST /files (and an additional path request parameter), or POST /files/{path} (path directly in URL) ?

@m-mohr m-mohr added this to the 1.3.0 milestone Mar 10, 2023
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

No branches or pull requests

2 participants