Open-EO / openeo-api

The openEO API specification
http://api.openeo.org
Apache License 2.0
91 stars 11 forks source link

Options for uploading an existing file #481

Open soxofaan opened 1 year ago

soxofaan commented 1 year ago

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

https://github.com/Open-EO/openeo-api/blob/16b1122c7090cc4fedcabace48686a4f73c1c876/openapi.yaml#L3332-L3337

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:

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 commented 1 year ago

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 commented 1 year ago

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) ?