gobaldia
gobaldia

Reputation: 420

Get all Fiware-ServicePath for a specific Fiware-Service

I need to know all the available Fiware-ServicePath for a specific Fiware-Service.

For example: I have the following:

Fiware-Service: MyCompany

Fiware-ServicePath: /app1

Fiware-ServicePath: /app2

Fiware-ServicePath: /app3

What I want is a service that retrieves something like these:

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

Thanks!

Upvotes: 1

Views: 277

Answers (1)

fgalan
fgalan

Reputation: 12294

Orion Context Broker API doesn't allow to get a list of service paths (at least in the current version, i.e. Orion 1.7.0). As a workaround, you can get the list if you have access to the DB, for example running this query:

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

A possibility would be to wrap the above query with a REST service (using ligthweight frameworks such as Flask in Python) and offer the information in a format as the one you suggest. It shouldn't be too difficult.

Upvotes: 2

Related Questions