FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
50 stars 43 forks source link

Issues when listing subscriptions #117

Closed jmcanterafonseca closed 5 years ago

jmcanterafonseca commented 5 years ago

A subscription is created with the following application/ld+json payload:

{"type":"Subscription","@context":"https://schema.lab.fiware.org/ld/context","entities":[{"type":"ParkingSpot"}],"watchedAttributes":["status"],"notification":{"endpoint":{"uri":"http://localhost:1880/notif-LD","accept":"application/ld+json"},"format":"normalized","attributes":["status"]}}

Then a GET /ngsi-ld/v1/subscriptions is issued as follows:

curl -X GET \
  http://localhost:1030/ngsi-ld/v1/subscriptions/ \
  -H 'Accept: application/json' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Host: localhost:1030' \
  -H 'Link: <https://schema.lab.fiware.org/ld/context>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
  -H 'Postman-Token: 3a91b721-797b-4e7f-8f1a-e07261cfd8c8,053e36cc-29bb-443f-8627-20b8adef1179' \
  -H 'User-Agent: PostmanRuntime/7.13.0' \
  -H 'accept-encoding: gzip, deflate' \
  -H 'cache-control: no-cache'
{
        "id": "urn:ngsi-ld:Subscription:5d13537c8cae7ee10f60ea97",
        "type": "Subscription",
        "entities": [
            {
                "type": "https://uri.fiware.org/ns/datamodels/ParkingSpot"
            }
        ],
        "watchedAttributes": [
            "https://uri.fiware.org/ns/datamodels/status"
        ],
        "notification": {
            "attributes": [
                "https://uri.fiware.org/ns/datamodels/status"
            ],
            "format": "normalized",
            "endpoint": {
                "uri": "http://localhost:1880/notif-LD",
                "accept": "application/ld+json"
            }
        },
        "expires": "2038-01-19T03:14:07Z"
    }
kzangeli commented 5 years ago

There is another issue about the same, returning the default context instead of what was sent. Issue: (to be looked up)

kzangeli commented 5 years ago

About "expires":

It's a part of the subscription, given or not at creation time. Similar to 'creationDate' and 'modificationDate', but not exactly the same ...

Three possibilities:

jmcanterafonseca commented 5 years ago

if the expiration date has not been provided then it has not been provided. you can keep an internal expires set to "infinite" but that does not mean that it should be rendered at all. the same with throttling.

kzangeli commented 5 years ago

Fixed in https://github.com/FIWARE/context.Orion-LD/pull/122