Cygnus-Orion订阅端点

时间:2019-01-18 13:15:02

标签: fiware-orion fiware-cygnus

Cygnus订阅到Orion 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
}'

1 个答案:

答案 0 :(得分:0)

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