forked from jvalue/ods
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadapter.http
More file actions
178 lines (153 loc) · 3.97 KB
/
Copy pathadapter.http
File metadata and controls
178 lines (153 loc) · 3.97 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
@baseURL = http://localhost:9000/api/adapter
### Get all supported protocols
GET {{baseURL}}/protocols HTTP/1.1
Content-Type: application/json
### Get all supported data formats
GET {{baseURL}}/formats HTTP/1.1
Content-Type: application/json
### Perform Data Import JSON
POST {{baseURL}}/dataImport HTTP/1.1
Content-Type: application/json
{
"protocol": {
"type": "HTTP",
"parameters": {
"location": "https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations.json",
"encoding": "UTF-8"
}
},
"format": {
"type": "JSON",
"parameters": {}
}
}
### Perform Data Import CSV
POST {{baseURL}}/dataImport HTTP/1.1
Content-Type: application/json;charset=UTF-8
{
"protocol": {
"type": "HTTP",
"parameters": {
"location": "https://www.bka.de/SharedDocs/Downloads/DE/Publikationen/PolizeilicheKriminalstatistik/2018/BKATabellen/FaelleLaenderKreiseStaedte/BKA-LKS-F-03-T01-Kreise_csv.csv?__blob=publicationFile&v=3",
"encoding": "ISO-8859-1"
}
},
"format": {
"type": "CSV",
"parameters": {
"columnSeparator": ";",
"lineSeparator": "\n",
"skipFirstDataRow": false,
"firstRowAsHeader": true
}
}
}
### Fetch imported data
// Use the id you got in the dataImport response
@dataId = 1
GET {{baseURL}}/data/{{dataId}} HTTP/1.1
Content-Type: application/json
### Get all datasources
GET {{baseURL}}/datasources HTTP/1.1
### Create a datasource
POST {{baseURL}}/datasources HTTP/1.1
Content-Type: application/json
{
"protocol": {
"type": "HTTP",
"parameters": {
"location": "https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations.json",
"encoding": "UTF-8"
}
},
"format": {
"type": "JSON",
"parameters": {}
},
"trigger": {
"firstExecution": "2018-10-07T01:32:00.123Z",
"periodic": true,
"interval": 60000
},
"metadata": {
"displayName": "pegelOnline",
"author": "icke",
"license": "none"
}
}
### Delete all datasources
DELETE {{baseURL}}/datasources/ HTTP/1.1
### Get all datasource events
GET {{baseURL}}/datasources/events HTTP/1.1
### Get latest datasource events
GET {{baseURL}}/datasources/events/latest HTTP/1.1
@datasourceId = 1
### Get all datasource events for datasource x
GET {{baseURL}}/datasources/events?datasourceId={{datasourceId}} HTTP/1.1
### Delete datasource x
DELETE {{baseURL}}/datasources/{{datasourceId}} HTTP/1.1
### Update datasource x
PUT {{baseURL}}/datasources/{{datasourceId}} HTTP/1.1
Content-Type: application/json
{
"protocol": {
"type": "HTTP",
"parameters": {
"location": "https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations.json",
"encoding": "UTF-8"
}
},
"format": {
"type": "JSON",
"parameters": {}
},
"trigger": {
"firstExecution": "2018-10-07T01:32:00.123Z",
"periodic": true,
"interval": 1000
},
"metadata": {
"author": "newauthor",
"license": "AGPL3"
}
}
### Perform manual data import without runtime parameters
POST {{baseURL}}/datasources/{{datasourceId}}/trigger HTTP/1.1
Content-Type: application/json
### Create datasource with dynamic parameters
POST {{baseURL}}/datasources HTTP/1.1
Content-Type: application/json
{
"protocol": {
"type": "HTTP",
"parameters": {
"location": "https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/{station}/W/measurements.json?start=P1D",
"encoding": "UTF-8",
"defaultParameters": {
"station": "BAMBERG"
}
}
},
"format": {
"type": "JSON",
"parameters": {}
},
"trigger": {
"firstExecution": "2018-10-07T01:32:00.123Z",
"periodic": false,
"interval": 60000
},
"metadata": {
"displayName": "pegelOnline",
"author": "icke",
"license": "none"
}
}
### Perform manual data import with runtime parameters
POST {{baseURL}}/datasources/{{datasourceId}}/trigger HTTP/1.1
Content-Type: application/json
{
"parameters": {
"station": "BONN"
}
}