forked from noi-techpark/bdp-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calls.http
244 lines (203 loc) · 5.67 KB
/
calls.http
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
##### VSCODE / REST Client
# Create a .env file and set the corresponding variables
# See all $dotenv fields below
### Get access token for the writer (LOCAL DEV)
# @name login
POST https://auth.opendatahub.testingmachine.eu/auth/realms/noi/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=odh-mobility-datacollector-development
&client_secret=7bd46f8f-c296-416d-a13d-dc81e68d0830
&scope=openid
### Get access token for UMA tests
# @name login
#
POST https://auth.opendatahub.testingmachine.eu/auth/realms/noi/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=odh-mobility-dev-uma
&client_secret=STFLg69cUgZS8nNgtUQIuZDMiPQBIipe
&scope=openid
### Get access token for the writer (TEST DB)
# @name login
POST https://auth.opendatahub.testingmachine.eu/auth/realms/noi/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=odh-mobility-datacollector
&client_secret=${{dotenv AUTH_TEST_CLIENT_SECRET}}
### Get access token for the writer (PROD DB)
# @name login
POST https://auth.opendatahub.com/auth/realms/noi/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=password
&username={{$dotenv AUTH_PROD_USERNAME}}
&password={{$dotenv AUTH_PROD_PASSWORD}}
&client_id=odh-mobility-datacollector-test
&client_secret={{$dotenv AUTH_PROD_CLIENT_SECRET}}
#@host=https://mobility.share.opendatahub.com
@host=http://localhost:8999
#@host=https://mobility.share.opendatahub.testingmachine.eu
@authtoken = {{login.response.body.access_token}}
### Get all stationtypes from the writer
GET {{host}}/json/stations?prn=dc-blabla&prv=1.0.2
Authorization: Bearer {{authtoken}}
### Get a single stationtype from the writer
GET {{host}}/json/stations/MeteoStation
Authorization: Bearer {{authtoken}}
### Get TrafficSensor stations (a22-elaborations)
GET {{host}}/json/stations/ON_DEMAND_VEHICLE
Authorization: Bearer {{authtoken}}
### Get TrafficSensor stations (a22-elaborations)
GET {{host}}/json/stations2/TrafficSensor
Authorization: Bearer {{authtoken}}
### Get EChargingStation stations
GET {{host}}/json/stations/TestStations
Authorization: Bearer {{authtoken}}
### Get a single stationtype from the writer
GET {{host}}/json/stations2/MeteoStation?origin=1111
Authorization: Bearer {{authtoken}}
### Get a single stationtype from the writer
GET {{host}}/json/stations/MeteoStation?origin=1111
Authorization: Bearer {{authtoken}}
### Get a single stationtype from the writer
GET {{host}}/json/provenance
Authorization: Bearer {{authtoken}}
### Get all datatypes from the writer
GET {{host}}/json/types
Authorization: Bearer {{authtoken}}
###
GET {{host}}/json/getDateOfLastRecord/TrafficSensor?stationId=A22:5416:2
Authorization: Bearer {{authtoken}}
### Post some data to the writer
POST {{host}}/json/provenance?prn=test&prv=11111
Content-Type: application/json
Authorization: Bearer {{authtoken}}
{
"uuid": "abcTESTabc",
"dataCollector": "TEST",
"dataCollectorVersion": "1.1.1.1.1.1",
"lineage": "xyz"
}
### Post a station
POST {{host}}/json/syncStations/EChargingStation34
?prn=test
&prv=11111
&syncState=true
&onlyActivation=true
&origin=Test123
Content-Type: application/json
Authorization: Bearer {{authtoken}}
[
{
"name": "PETER",
"id": "PETER",
"stationType": "EChargingStation",
"origin": "abc"
}
]
### Post stations states with "origin"
POST {{host}}/json/syncStationStates/EChargingStation/ALPERIA?prn=test&prv=11111
Content-Type: application/json
Authorization: Bearer {{authtoken}}
[
"HER_00000059",
"HER_00000003",
"ASM_00000456",
"A15_00000003"
]
### Post stations states without an "origin"
POST {{host}}/json/syncStationStates/EChargingStation?prn=test&prv=11111
Content-Type: application/json
Authorization: Bearer {{authtoken}}
[
"HER_00000059",
"HER_00000003",
"ASM_00000456",
"A15_00000003"
]
###
POST {{host}}/json/syncStationStates/EChargingStation/origin123
?prn=test
&prv=11111
&onlyActivation=true
Content-Type: application/json
Authorization: Bearer {{authtoken}}
[
"HER_00000059",
"HER_00000003",
"ASM_00000456",
"A15_00000003"
]
### Push Records
POST {{host}}/json/pushRecords/RWISstation
Content-Type: application/json
Authorization: Bearer {{authtoken}}
{
"name": "(default)",
}
### Actuator / Healthcheck
GET {{host}}/actuator/health
###
GET {{host}}/error
### Sync data types
POST {{host}}/json/syncDataTypes
?prn=test
&prv=11111
Content-Type: application/json
Authorization: Bearer {{authtoken}}
[
{
"name":"docs-example-type",
"unit":"odh-docs-unit",
"rtype":"docs-example-rtype",
"description":"docs-example description",
"period": 600,
"metadata":
{
"extra":"fields"
}
},
{
"name":"docs-example-type-2",
"unit":"odh-docs-unit",
"rtype":"docs-example-rtype",
"description":"docs-example description",
"period": 300,
"metadata":
{
"even-more":"fields"
}
}
]
### Sync stations
POST {{host}}/json/syncStations/testtype
?prn=test
&prv=11111
&syncState=false
&onlyActivation=false
Content-Type: application/json
Authorization: Bearer {{authtoken}}
[
{
"id": "example-station-id-1",
"name": "example-station-name-1",
"origin": "testorigin",
"latitude": 46.333,
"longitude": 11.356,
"municipality": "Bolzano",
"metaData" : {
"additional": "fields"
}
},
{
"id": "example-station-id-2",
"name": "example-station-name-2",
"origin": "testorigin",
"latitude": 46.333,
"longitude": 11.356,
"municipality": "Bolzano",
"metaData" : {
"additional": "fields"
}
}
]