unioslo / tsd-api-client

Command line client for the TSD HTTP API
BSD 3-Clause "New" or "Revised" License
13 stars 5 forks source link

Handle upload sync passed for initial transfers #116

Open haatveit opened 1 year ago

haatveit commented 1 year ago

Currently tacl will fail on attempted tacl --upload-sync if the base directory doesn't exist remotely.

$ tacl p11 --env test --upload-sync dist
uploading directory dist
fetching information about directory: dist
405 Client Error: Method not allowed for url: https://test.api.tsd.usit.no/v1/p11/files/stream/p11-member-group/dist?per_page=10000
The request was unsuccesful. Exiting.

I think 405 method not allowed for upload sync should be interpreted as a signal to try switching to normal uploading (we could also create the remote base directory and "sync", but I don't think there's any point in using the sync code path for an initial upload).