-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_rest
executable file
·65 lines (39 loc) · 2.08 KB
/
test_rest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
PORT=4000
# GET jwt token
TOKEN=$(curl -X GET http://localhost:$PORT/token | jq -r '.token')
# POST tree file
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: multipart/form-data" -F "treefile=@/home/filip/Dropbox/JavaProjects/spread3-web/src/test/resources/continuous/speciesDiffusion.MCC.tre" http://localhost:$PORT/continuous/tree
echo -e '\n'
# GET attributes
curl -X GET -H "Authorization: Bearer $TOKEN" http://localhost:$PORT/continuous/attributes
echo -e '\n'
# GET hpd-levels
curl -X GET -H "Authorization: Bearer $TOKEN" http://localhost:$PORT/continuous/hpd-levels
echo -e '\n'
# POST hpd-level
curl -X POST -H "Authorization: Bearer $TOKEN" --data "hpd-level=0.80" http://localhost:$PORT/continuous/hpd-level
echo -e '\n'
# POST ycoordinate
curl -X POST -H "Authorization: Bearer $TOKEN" --data "attribute=trait1" http://localhost:$PORT/continuous/coordinates/y
echo -e '\n'
# POST xcoordinate
curl -X POST -H "Authorization: Bearer $TOKEN" --data "attribute=trait2" http://localhost:$PORT/continuous/coordinates/x
#echo -e '\n'
# POST external-annotations
curl -X POST -H "Authorization: Bearer $TOKEN" --data "has-external-annotations=true" http://localhost:$PORT/continuous/external-annotations
echo -e '\n'
# POST timescale-multiplier
curl -X POST -H "Authorization: Bearer $TOKEN" --data "timescale-multiplier=0.95" http://localhost:$PORT/continuous/timescale-multiplier
echo -e '\n'
# POST mrsd
curl -X POST -H "Authorization: Bearer $TOKEN" --data "mrsd=2017/04/06" http://localhost:$PORT/continuous/mrsd
echo -e '\n'
# POST geojson file
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: multipart/form-data" -F "geojsonfile=@/home/filip/Dropbox/JavaProjects/spread3-web/src/test/resources/geojson/subregion_Australia_and_New_Zealand_subunits.geojson" http://localhost:$PORT/continuous/geojson
# GET model settings
curl -X GET -H "Authorization: Bearer $TOKEN" http://localhost:$PORT/continuous/model
echo -e '\n'
# GET json output
#curl -X GET -H "Authorization: Bearer $TOKEN" http://localhost:$PORT/continuous/output
echo -e '\n'