Commit cb34a3df authored by Federico Sismondi's avatar Federico Sismondi

Add Device subscription to QuantumLeap (historical API) for BRAILA pilot

parent d7d1e5d4
#!/usr/bin/env bash
[[ -z "$ORION_HOST" ]] && echo "Please set ORION_HOST env var. E.g. export ORION_HOST=127.0.0.1" && exit
echo "Querying context broker at: ${ORION_HOST}"
# API NOTES:
# "condition": { "attrs": [] } -> means monitor all the attributes in the entity
curl --location --request POST \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: braila" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{
"description": "Notify QuantumLeap, the historic API for important changes in Device entity",
"subject": {
"entities": [
{
"idPattern": ".*",
"type": "Device"
}
],
"condition": {
"attrs": ["controlledProperty","value","serialNumber","name","rssi","batteryLevel"]
}
},
"notification": {
"http": {
"url": "http://172.18.1.7:8668/v2/notify"
},
"attrs": ["controlledProperty","value","serialNumber","name","rssi","batteryLevel"],
"metadata": ["dateCreated", "dateModified"]
}
}'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment