nomad-coe / nomad

NOMAD lets you manage and share your materials science data in a way that makes it truly useful to you, your group, and the community.
https://nomad-lab.eu
Apache License 2.0
64 stars 14 forks source link

Upload streaming example doesn't work #16

Closed ondracka closed 3 years ago

ondracka commented 3 years ago

The example in "uploads / alternative shell commands" where one is supposed to tar a folder, send the output through pipe to curl and upload through streaming is not working.

tar -cf - <local_folder> | curl -# -H "http://nomad-lab.eu/prod/rae/api/uploads/?token=........." -T - | xargs echo

This actually leads to curl: no URL specified!. Tested with curl 7.29.0 and 7.66.0.

ondracka commented 3 years ago

It seems to work if I remove the -H switch, but I have no idea if this is the correct way to fix it?

ondracka commented 3 years ago

There might be more problems with the "Alternative shell commands" help.

In line NOMAD accepts stream data (-T <local_file>) (like in the examples above) or multi-part form data (-X PUT -f file=@<local_file>):, there should probably be -F instead of -f and in the last example for "Upload names" curl "https://oasis.mch.rwth-aachen.de/nomad-oasis/api/uploads/?token=.........&name=<name>" -X PUT -T <local_file> there are both -X and -T switches used which seems strange?

markus1978 commented 3 years ago

Fix merged into v0.10.4, will be on central NOMAD after the next release.

ondracka commented 3 years ago

Confirming fixed. Thank you @markus1978