1
votes

We try to get bikerenting data from public instance of fiware-orion. We followed the description in the API doc

No matter how we supply "limit" and "offset" params, we don't get more than ten entries.

To reproduce, you need a Fiware account. With your credentials you can request a token

curl -s -d "{\"username\": \"USERNAME\", \"password\":\"PASSWORD\"}" -H "Content-Type: application/json" https://orion.lab.fiware.org/token

Once you have the token, you can query orion

curl "http://orion.lab.fi-ware.org:1026/ngsi10/queryContext?limit=200&offset=0&details=off" -s -S -H"X-Auth-Token:TOKEN" --header 'Content-Type: application/json' --header 'Accept: application/json' -d ' {"entities":[{"type":"bikerenting","isPattern":true,"id":"Tusbic.*"}]}'

This gives us the entities with the following ids

    "id" : "Tusbic.2",
    "id" : "Tusbic.3",
    "id" : "Tusbic.4",
    "id" : "Tusbic.5",
    "id" : "Tusbic.6",
    "id" : "Tusbic.7",
    "id" : "Tusbic.8",
    "id" : "Tusbic.9",
    "id" : "Tusbic.10",
    "id" : "Tusbic.11",

When we change the id in the query to some other value, for example to "Tusbic.12", we get the data for that entity. Which proves that there are more entities than just ten.

Does anyone knows how to get proper pagination?

1

1 Answers

0
votes

As far as we have checked "Tusbic.*" entities are not managed locally by Orion instance at orion.lab.fiware.org, but by a Context Provider registrated in that instance. Up to now, Orion was running with a CPr forwarding capping of 10 (-cprForwardLimit 10) for performance reasons.

Limit has been raised to 50 and it seems that now the query works ok (up to 16 entities are returned):

curl 'http://orion.lab.fi-ware.org:1026/ngsi10/queryContext?limit=200&offset=0&details=off' -s -S -H"X-Auth-Token:TOKEN" --header 'Content-Type: application/json' --header 'Accept: application/json' -d ' {"entities":[{"type":"bikerenting","isPattern":"true","id":"Tusbic.*"}]}'  | grep Tusbic
        "id" : "Tusbic.2",
        "id" : "Tusbic.3",
        "id" : "Tusbic.4",
        "id" : "Tusbic.5",
        "id" : "Tusbic.6",
        "id" : "Tusbic.7",
        "id" : "Tusbic.8",
        "id" : "Tusbic.9",
        "id" : "Tusbic.10",
        "id" : "Tusbic.11",
        "id" : "Tusbic.12",
        "id" : "Tusbic.13",
        "id" : "Tusbic.14",
        "id" : "Tusbic.15",
        "id" : "Tusbic.16",
        "id" : "Tusbic.17",