-
Notifications
You must be signed in to change notification settings - Fork 4
/
api_exemples.sh
executable file
·102 lines (94 loc) · 3.29 KB
/
api_exemples.sh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
echo "404"
curl -i http://127.0.0.1:6543/tratra -X GET -H "Content-Type: application/json"
echo "Get fields, limit the enumeration lists to 20"
curl -i http://127.0.0.1:6543/get-fields -X POST -H "Content-Type: application/json" --data '{"limit": 20}'
echo "Get fields, limit the enumeration lists to 20"
curl -i http://127.0.0.1:6543/get-fields/limit/20 -X GET -H "Content-Type: application/json"
echo "Get fields for collection VirusSequences, limit the enumeration lists to 20"
curl -i http://127.0.0.1:6543/get-fields/VirusSequences/limit/20 -X GET -H "Content-Type: application/json"
echo "Get values with join"
curl -i http://127.0.0.1:6543/get-data -X POST -H "Content-Type: application/json" --data '{
"payload": {
"query":{
"Peptides.Score": {
"values": [0.7, 1]
},
"Peptides.Length": {
"values": [9]
},
"VirusSequences.Family": {
"values": ["Coronaviridae"]
}
},
"join": ["VirusSequences.Accession", "Peptides.Accession"],
"limit": 3,
"sort": {
"field": "Peptides.Score",
"direction": "DESC"
},
"additional_fields":["VirusSequences.Sequence", "Peptides.Sequence"]
}
}'
echo "Get values without join"
curl -i http://127.0.0.1:6543/get-data -X POST -H "Content-Type: application/json" --data '{
"payload": {
"query":{
"Peptides.Score": {
"values": [0.7, 1]
}
},
"limit": 3,
"sort": {
"field": "Peptides.Score",
"direction": "DESC"
},
"additional_fields":["Peptides.Sequence"]
}
}'
echo "Get peptides with a score >=0.7"
curl -i http://127.0.0.1:6543/get-data -X POST -H "Content-Type: application/json" --data '{
"payload": {
"query":{
"Peptides.Score": {
"values": [0.7, ":"]
}
},
"limit": 3,
"sort": {
"field": "Peptides.Score",
"direction": "DESC"
},
"additional_fields":["Peptides.Sequence"]
}
}'
echo "Get peptides with a index >=10"
curl -i http://127.0.0.1:6543/get-data -X POST -H "Content-Type: application/json" --data '{
"payload": {
"query":{
"Peptides.Index": {
"values": [10, ":"]
}
},
"limit": 3,
"sort": {
"field": "Peptides.Score",
"direction": "DESC"
},
"additional_fields":["Peptides.Sequence", "Peptides.Index"]
}
}'
echo "Get peptides with a index >=10"
curl -i http://127.0.0.1:6543/get-data -X POST -H "Content-Type: application/json" --data '{
"payload": {
"query":{
"Peptides.Score": {
"values": [0, ":"]
}
},
"limit": 2000,
"sort": {
"direction": "RAND"
},
"additional_fields":["Peptides.Sequence"]
}
}'