view scripts/api/data-deposit/upload-file @ 11:08c950a22cee

new: add getAllDataverseAlias api for LGServices
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 09 Sep 2015 17:13:18 +0200
parents a50cf11e5178
children
line wrap: on
line source

#!/bin/bash -x
USERNAME=spruce
PASSWORD=spruce
DVN_SERVER=localhost:8181
if [ -z "$1" ]; then
  EDIT_MEDIA_URL=`scripts/api/data-deposit/list-datasets | xpath 'string(//link/@href)' 2>/dev/null`
else
  EDIT_MEDIA_URL=$1
fi
curl -s --insecure --data-binary @scripts/search/data/binary/trees.zip -H "Content-Disposition: filename=trees.zip" -H "Content-Type: application/zip" -H "Packaging: http://purl.org/net/sword/package/SimpleZip" -u $USERNAME:$PASSWORD $EDIT_MEDIA_URL \
| xmllint -format -
#curl -s --insecure --data-binary @scripts/search/data/binary/trees.zip -H "Content-Disposition: filename=trees.zip" -H "Content-Type: application/zip" -H "Packaging: http://purl.org/net/sword/package/SimpleZip" https://$USERNAME:$PASSWORD@$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/edit-media/study/doi:10.5072/FK2/19 \
#| xmllint -format -