获取特定 Fiware-Service 的所有 Fiware-ServicePath

Get all Fiware-ServicePath for a specific Fiware-Service

我需要知道特定 Fiware-Service 的所有可用 Fiware-ServicePath

例如:我有以下内容:

Fiware-Service: MyCompany

Fiware-ServicePath: /app1

Fiware-ServicePath: /app2

Fiware-ServicePath: /app3

我想要的是检索类似以下内容的服务:

{
    - {
        Service: "/app1"
      },
    - {
        Service: "/app2"
      },
    - {
        Service: "/app3"
      }
}

谢谢!

Orion Context Broker API 不允许获取服务路径列表(至少在当前版本中,即 Orion 1.7.0)。作为解决方法,如果您有权访问数据库,则可以获得列表,例如 运行 此查询:

> db.entities.aggregate([{$group: {_id: "$_id.servicePath"}}])

一种可能性是用 REST 服务包装上述查询(使用 Python 中的 Flask 等轻量级框架)并以您建议的格式提供信息。应该不会太难。