Context broker: can we subscribe to all context updates?

I use Fiware cygnus to subscribe to orion context proxies. Can I subscribe to all context updates with a single script? I do not want to do this one by one. Here is an example subscription:

(curl 192.168.1.79:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Fiware-Service: test' --header 'Fiware-ServicePath: /testPath' -d @- | python -mjson.tool) <<EOF { "entities": [ { "type": "room", "isPattern": "false", "id": "temperature" } ], "attributes": [ "tmpValue" ], "reference": "http://192.168.1.40:5050/notify", "duration": "P1M", "notifyConditions": [ { "type": "ONCHANGE", "condValues": [ "tmpValue" ] } ], "throttling": "PT1S" } EOF 
+4
source share
1 answer

You can subscribe to changes in any object using the following:

 { "entities": [ { "type": "", "isPattern": "true", "id": ".*" } ], "attributes": [ ], "reference": "http://192.168.1.40:5050/notify", "duration": "P1M", "notifyConditions": [ { "type": "ONCHANGE", "condValues": [ "tmpValue" ] } ], "throttling": "PT1S" } 

Thus, the notification will include all the attributes of the object and is generated every time the tmpValue attribute tmpValue . Currently (Orion 0.23.0) you cannot subscribe to changes in any attribute (you need to know the list of attributes to monitor during the subscription), but it is planned as a future function.

EDIT: since Orion 0.27.0 you can subscribe to changes in any attribute. To do this, subscribe by omitting the condValues field (or use an empty array [] as a value).

+2
source

All Articles