Sending Data from Orion to Cygnus

Orion Context Broker Configuration

To send context data from Orion to Cygnus, you need to subscribe Cygnus to Orion. This is done by creating a subscription in Orion that will notify Cygnus of changes in context data.

Example Subscription

Send the following request to the Orion Context Broker API to subscribe Cygnus to an entity’s context changes:

curl -iX POST \
  'http://<orion_host>:1026/v2/subscriptions' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "Notify Cygnus of context changes",
    "subject": {
      "entities": [
        {
          "idPattern": ".*",
          "type": "Room"
        }
      ]
    },
    "notification": {
      "http": {
        "url": "http://<cygnus_host>:5050/notify"
      },
      "attrs": ["temperature", "humidity"]
    },
    "throttling": 5
  }'
  • url: This is the Cygnus endpoint where Orion sends notifications. Ensure that the URL points to the correct Cygnus host and port (5050 in this case).

  • entities: The entities you want to monitor. In this case, we monitor entities of type Room.

  • attrs: The specific attributes to track (e.g., temperature, humidity).

Once this subscription is created, any changes in the Room entity will be sent to Cygnus for persistence in the configured storage system.