comparison scripts/api/setup-dvs.sh @ 10:a50cf11e5178

Rewrite LGDataverse completely upgrading to dataverse4.0
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 08 Sep 2015 17:00:21 +0200
parents
children
comparison
equal deleted inserted replaced
9:5926d6419569 10:a50cf11e5178
1 #!/bin/bash -f
2 SERVER=http://localhost:8080/api
3 echo Setting up dataverses on $SERVER
4 echo ==============================================
5 if [ $# -eq 0 ]
6 then
7 echo "Please supply Pete and Uma's API keys like so:"
8 echo "$0 [pete's key] [uma's key]"
9 echo "The keys are printed at the end of the setup-users.sh script"
10 echo "Or, just get them from the database"
11 exit 1
12 fi
13
14 echo Pete
15 curl -s -H "Content-type:application/json" -X POST -d @data/dv-pete-top.json "$SERVER/dataverses/root?key=$1"
16 echo
17 curl -s -H "Content-type:application/json" -X POST -d @data/dv-pete-sub-normal.json "$SERVER/dataverses/peteTop?key=$1"
18 echo
19 curl -s -H "Content-type:application/json" -X POST -d @data/dv-pete-sub-restricted.json "$SERVER/dataverses/peteTop?key=$1"
20 echo
21 curl -s -H "Content-type:application/json" -X POST -d @data/dv-pete-sub-secret.json "$SERVER/dataverses/peteTop?key=$1"
22 echo
23
24 echo Uma
25 echo Pete creates top-level for Uma
26 curl -s -H "Content-type:application/json" -X POST -d @data/dv-uma-top.json "$SERVER/dataverses/root?key=$1"
27 echo
28 echo Pete makes Uma an admin on her own DV
29 curl -s -H "Content-type:application/json" -X POST -d"{\"assignee\":\"@uma\",\"role\":\"admin\"}" $SERVER/dataverses/umaTop/assignments/?key=$1
30 echo
31 curl -s -H "Content-type:application/json" -X POST -d @data/dv-uma-sub1.json "$SERVER/dataverses/umaTop?key=$2"
32 echo
33 curl -s -H "Content-type:application/json" -X POST -d @data/dv-uma-sub2.json "$SERVER/dataverses/umaTop?key=$2"
34 echo
35
36