Does Orion support restrictions on subscriptions? Ex. I want to receive context updates only when temperature > 30
2
votes
1 Answers
0
votes
That functionality is not implemented in NGSIv1, but planned for NGSIv2 (see conditions
field in "Subscriptions" at the NGSIv2 draft specification). However, it has not been yet implemented in the last Orion version at the time of writting this (0.25.0).
EDIT: this functionality has been finally implemented in Orion 0.27.0, eg:
POST /v2/subscriptions
...
{
"subject": {
"entities": [
{
"idPattern": ".*",
"type": "device"
}
],
"condition": {
"attributes": [ "temperature" ],
"expression": {
"q": "temperature>30"
}
}
},
"notification": {
"callback": "http://foo.bar:5050/notify",
"attributes": [ ]
},
"expires": "2050-04-05T14:00:00.00Z"
}