Search code examples
fiware-cygnus

Does Cygnus already accept NGSI2?


Based on this post (Fiware - Context broker: Issue with NGSIv2 subscriptions) a few months ago it was under discussion whether Cygnus supported NGSIv2 or not. It was commented that the issue were schedule but not yet implemented.

Question: Is it implemented already? how can we know?

My confusion reminds because when creating a subscription based on NGSIv2, and outcome of successfully created message pop up (i.e., 201), but still cannot monitor my subscription record into Orion.

I'm creating my subscription like this:

Content-Type:application/json
Accept: application/json
Fiware-Service: test
Fiware-ServicePath: /device

{ 
      "description": "One subscription to rule them all",  
      "subject": {    
        "entities": [ {        
          "idPattern": ".*",        
          "type": "smarthphone" } ],    
        "condition": {      
          "attrs": [ "battery" ], 
          "expression": { "q": "battery!=0" }    
          }
        },  
        "notification": {    
        "http": {      
          "url": "<MY COSMOS IP>:5050/notify" },    
          "attrs": [ "battery" ]  
        },  
        "expires": "2120-04-05T14:00:00.00Z",  
        "throttling": 1
    }

And this is what I get:

Connection: Keep-Alive
Content-Length: 0
Location: /v2/subscriptions/587c62fcfebdbe5f74bad77b
Fiware-Correlator: f9a96bd0-dbb1-11e6-93ea-0242ac110004
Date: Mon, 16 Jan 2017 06:06:52 GMT

But when I retrieve such subscription it does't show:

.../v2/subscriptions/587c62fcfebdbe5f74bad77b

Any hint of what am I doing wrong?


Solution

  • If you have entities created with headers Fiware-Service: test and Fiware-ServicePath: /device , you also need to use these headers in your requests (GET, PUT, etc.).