Cygnus-Orion 订阅端点

Cygnus-Orion subscription endpoint

订阅 CygnusOrion CB 订阅更改的最佳端点是什么:/v1/subscribeContext/v2/subscriptions

试过这个,没有反应:

$(curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Fiware-Service: smartGondor' --header 'Fiware-ServicePath: /gardens' -d @- | python -mjson.tool) <<EOF
{
    "entities": [
        {
            "type": "Device",
            "isPattern": "false",
            "id": "raspiSensorTV"
        }
    ],
    "attributes": [
        "Temperature Sensor",
        "TimeInstant"
    ],
    "reference": "http://localhost:5050/notify",
    "duration": "P1M",
    "notifyConditions": [
        {
            "type": "ONCHANGE",
            "condValues": [
                "Temperature Sensor"
            ]
        }
    ],
    "throttling": "PT1S"
}
EOF

这似乎可行,但不确定这是否是最好的方法,因为没有收到任何观察结果。

$curl -iX POST \
  'http://localhost:1026/v2/subscriptions' \
  -H 'Content-Type: application/json' \
  -H 'fiware-service: smartGondor' \
  -H 'fiware-servicepath: /gardens' \
  -d '{
  "description": "Notify Cygnus of all context changes",
  "subject": {
    "entities": [
    {
        "idPattern": ".*",
      "type": "Device"
    }
    ]
  },
  "notification": {
    "http": {
    "url": "http://cygnus:5050/notify"
    },
    "attrsFormat": "legacy"
  },
  "throttling": 5
}'

目前 Cygnus 不支持 NGSIv2 通知,因此您需要使用 NGSIv1 端点。您可以找到更多信息 in this section of Cygnus documentation and this other.