Skip to content

Commit 153a01b

Browse files
authored
Update README.md
1 parent 104ca12 commit 153a01b

File tree

1 file changed

+16
-103
lines changed

1 file changed

+16
-103
lines changed

README.md

+16-103
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ curl --location --request PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:n
106106
}
107107
}'
108108
```
109+
Being:
110+
- idStation: station id
111+
- month: [1, 2, 3, ..., 12]
112+
- weekday: [1, ..., 7] (1 ->Sunday 7->Saturday)
113+
- time: : [0, ... , 23]
114+
- predictionId: String to identify the prediction in the consuming application
115+
- socketId: String to identify the socket with the client in the consuming application
109116

110117
3) See if the `ResSantanderBikePrediction1` changes
111118

@@ -163,131 +170,37 @@ docker compose up -d
163170
* Example of petition made to ask for a prediction:
164171

165172
```
166-
curl --location --request PATCH 'http://broker-yoda.dit.upm.es/ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
173+
curl --location --request PATCH 'http://138.4.22.130/ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
167174
--header 'Content-Type: application/json' \
168-
--data-raw '{
169-
"month":{
170-
"type":"Property",
171-
"value":9
172-
},
173-
"idStation": {
174-
"type":"Property",
175-
"value":11
176-
},
177-
"weekday":{
178-
"type":"Property",
179-
"value":2
180-
},
181-
"hour":{
182-
"type":"Property",
183-
"value":23
184-
},
185-
"predictionId":{
186-
"type":"Property",
187-
"value":"p-1662768034900"
188-
},
189-
"socketId":{
190-
"type":"Property",
191-
"value":"Fn0kKHEF-dOcr311AAAF"
192-
}
193-
}'
175+
--data-raw '{...}'
176+
194177
```
195178

196-
Being:
197-
- idStation: station id
198-
- month: [1, 2, 3, ..., 12]
199-
- weekday: [1, ..., 7] 1 ->Sunday 7->Saturday
200-
- time: : [0, ... , 23]
201-
- predictionId: String to identify the prediction in the consuming application
202-
- socketId: String to identify the socket with the client in the consuming application
203179

204180
### Testing everything worked
205181

206182
1) Validate that the subscription and entities exist:
207183
```
208-
curl --location --request GET 'http://broker-yoda.dit.upm.es/ngsi-ld/v1/subscriptions/'
184+
curl --location --request GET 'http://138.4.22.130/ngsi-ld/v1/subscriptions/'
209185
```
210186

211187
```
212-
curl --location --request GET 'http://broker-yoda.dit.upm.es/ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1'
188+
curl --location --request GET 'http://138.4.22.130/ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1'
213189
```
214190

215191
```
216-
curl --location --request GET 'http://broker-yoda.dit.upm.es/ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
192+
curl --location --request GET 'http://138.4.22.130/ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
217193
```
218194

219195
2) Update the `ReqSantanderBikePrediction1`
220196
```
221-
curl --location --request PATCH 'http://broker-yoda.dit.upm.es/ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
197+
curl --location --request PATCH 'http://138.4.22.130/ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
222198
--header 'Content-Type: application/json' \
223-
--data-raw '{
224-
"month":{
225-
"type":"Property",
226-
"value":9
227-
},
228-
"idStation": {
229-
"type":"Property",
230-
"value":11
231-
},
232-
"weekday":{
233-
"type":"Property",
234-
"value":2
235-
},
236-
"hour":{
237-
"type":"Property",
238-
"value":23
239-
},
240-
"predictionId":{
241-
"type":"Property",
242-
"value":"p-1662768034900"
243-
},
244-
"socketId":{
245-
"type":"Property",
246-
"value":"Fn0kKHEF-dOcr311AAAF"
247-
}
248-
}'
199+
--data-raw '{...}'
249200
```
250201

251202
3) See if the `ResSantanderBikePrediction1` changes
252203

253204
```
254-
curl --location --request GET 'http://broker-yoda.dit.upm.es/ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
255-
```
256-
257-
Response:
258-
```
259-
{
260-
"@context":"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld",
261-
"id":"urn:ngsi-ld:ResSantanderBikePrediction1",
262-
"type":"ResSantanderBikePrediction",
263-
"socketId":{
264-
"type":"Property",
265-
"value":"Fn0kKHEF-dOcr311AAAF"
266-
},
267-
"predictionId":{
268-
"type":"Property",
269-
"value":"p-1662768034900"
270-
},
271-
"predictionValue":{
272-
"type":"Property",
273-
"value":15
274-
},
275-
"idStation":{
276-
"type":"Property",
277-
"value":"11"
278-
},
279-
"weekday":{
280-
"type":"Property",
281-
"value":2
282-
},
283-
"hour":{
284-
"type":"Property",
285-
"value":22
286-
},
287-
"month":{
288-
"type":"Property",
289-
"value":9
290-
}
205+
curl --location --request GET 'http://138.4.22.130/ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
291206
```
292-
Result of prediction: 15 bikes available
293-
- predictionValue: number of bikes available

0 commit comments

Comments
 (0)