Skip to content

Commit a2db925

Browse files
committed
Register sources
1 parent fbd8d5c commit a2db925

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

import-data

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,49 @@ curl -s -o /dev/null -X POST 'http://'"${CONTEXT_BROKER}"'/ngsi-ld/v1/entityOper
220220
}
221221
]'
222222

223+
echo -e "Registering Farmer and Devices as data sources.\n"
224+
225+
curl -s -o /dev/null -X POST 'http://'"${CONTEXT_BROKER}"'/ngsi-ld/v1/csourceRegistrations/' \
226+
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json' \
227+
-H 'Content-Type: application/json' \
228+
-d '{
229+
"type": "ContextSourceRegistration",
230+
"information": [
231+
{
232+
"entities": [
233+
{
234+
"type": "Animal"
235+
}
236+
]
237+
}
238+
],
239+
"mode": "redirect",
240+
"operations": [
241+
"redirectionOps"
242+
],
243+
"endpoint": "http://farmer"
244+
}'
245+
246+
247+
curl -s -o /dev/null -X POST 'http://farmer/ngsi-ld/v1/csourceRegistrations/' \
248+
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json' \
249+
-H 'Content-Type: application/json' \
250+
-d '{
251+
"type": "ContextSourceRegistration",
252+
"information": [
253+
{
254+
"entities": [
255+
{
256+
"type": "Animal"
257+
}
258+
]
259+
}
260+
],
261+
"mode": "inclusive",
262+
"operations": [
263+
"federationOps"
264+
],
265+
"endpoint": "http://devices"
266+
}'
267+
223268
echo -e " \033[1;32mdone\033[0m"

0 commit comments

Comments
 (0)