首页 > 解决方案 > Orion CB:无法通过 /v2/entities 端点访问实体

问题描述

在使用 创建wirecloud 布线NGSI Source operator时,我遇到了几天的错误(无助的错误),与我的 Orion CB 实例的连接有关。我可以确认输入的所有其他 NGSI 操作员设置都是正确的。

Error creating subscription in the context broker server: Connection Error

但是,我怀疑此错误与 Orion 未找到订阅 NGSI Source 运算符的实体有关。这是因为我尝试访问 Eindhoven 的经纪人 ( http://212.159.228.70:1026/ ) 并且它有效,NGSI Source 运营商订阅创建成功。

同样,我使用以下方法获取埃因霍温经纪人中的所有实体/属性:

Akil$http http://212.159.228.70:1026/v2/entities
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 15501
Content-Type: application/json
Date: Mon, 13 May 2019 10:20:20 GMT
Fiware-Correlator: b5e5294a-7568-11e9-83c8-0242ac120003

[
    {
        "NO2": {
            "metadata": {},
            "type": "Number",
            "value": 27.5
        },
        "Ozon": {
            "metadata": {},
            "type": "Number",
            "value": 59.5
        },
        "PM1": {
            "metadata": {},
            "type": "Number",
            "value": 8
        },
        "PM10": {
            "metadata": {},
            "type": "Number",
            "value": 12
        },
   .
   .
}
]

但是我无法使用相同的场景在我的 Orion 实例中获取实体:

Akil$ http 193.136.xx.xx:53154/v2/entities
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 2
Content-Type: application/json
Date: Mon, 13 May 2019 10:36:13 GMT
Fiware-Correlator: ee22e4b2-756a-11e9-afa1-0242ac160007

[]

返回空列表,而我有 2 FIWARE 服务可用:environmenturbansense. 我想要访问的实体可通过urbansense具有/basicfiware-servicepath 的 fiware-service 获得。

服务健康:

Akil$ http 193.136.xx.xx:53154/version
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 345
Content-Type: application/json
Date: Mon, 13 May 2019 10:50:13 GMT
Fiware-Correlator: e32bf3da-756c-11e9-9371-0242ac160007

{
    "orion": {
        "compile_time": "Tue Feb 12 10:51:10 UTC 2019",
        "compiled_by": "root",
        "compiled_in": "4f8128ac7b5b",
        "doc": "https://fiware-orion.rtfd.io/",
        "git_hash": "7ae8c69b97cd875236b952322a6bd503debbd13d",
        "release_date": "Tue Feb 12 10:51:10 UTC 2019",
        "uptime": "6 d, 18 h, 7 m, 6 s",
        "version": "2.1.0-next"
    }
}

问题:

  1. 为什么我不能像访问 Eindhoven 的代理一样访问我的 Orion 实例?
  2. 这就是我为 NGSI Source 操作员接线失败,从而报告上述订阅错误的原因吗?

标签: fiwarefiware-orionfiware-wirecloud

解决方案


我不确定是否完全理解您的情况(特别是与 Wirecloud 的关系,因为我不是 Wirecloud 方面的专家),但让我们尝试回答...... :)

从:

[GET /v2/entities] 返回空列表,而我有 2 个 FIWARE 服务:environmenturbansense. 我想要访问的实体可通过具有/basicfiware-servicepath 的 urbansense fiware-service 获得。

如果您要访问的实体在给定的服务和子服务中可用,那么您应该将 then 添加到 GET 请求中。我不知道http命令是如何工作的,但如果是curl这样的话

curl -H 'fiware-service: environment' and -H 'fiware-servicepath: /basic' http://212.159.228.70:1026/v2/entities

推荐阅读