Open agaldemas opened 5 years ago
What I don't understand is that if I introduce a log.error to print headers it's never displayed, or if I remove controller.py and controller.pyc in right_time_context directory and restart the container, ckan doesn't complain like if the file is not used at all ? Have someone any explanation on this strange behavior ?
OK, I finally manage to query Orion with ckan right_time_context, by using the NGSI view type, the headers are sent in the request... meaning that the query is done differently with text view (using another module inside ckan, strange behavior...
This should be indicated clearly in the user documentation, which is not the case...
Well, the point is that the plugin is only used to save the query as dataset resource. Is the NGSI view the one that executes the query and displays the data, other views will not work as they are not NGSI aware
I made a test with Right_time_context, towards Orion: configured a dataset with format fiware-ngsi the tenant and service path are both filled with value in the interface, but are not transmitted to Orion in request: log result from Orion:
orion_1 | time=Monday 11 Feb 16:09:23 2019.266Z | lvl=WARN | corr=6572ca14-2e17-11e9-a839-0242ac14000c | trans=1549831530-835-00000000529 | from=172.20.0.20 | srv=<default> | subsrv=<default> | comp=Orion | op=AlarmManager.cpp[405]:badInput | msg=Raising alarm BadInput 172.20.0.20: bad verb for url '/v2/entities
instead of:
| srv=testservice | subsrv=/# |
I traced the request sent by ckan right_time_context (with : http-echo).And here is the request translated in json:
As you can see it miss:( tenant and service path declared and visible in the interface (don't worry Orion is case unsensitive for header parameter keys)
They are not in the header, then Orion can't find any entity. I re-build the image from Dockerfile, to check if I was missing an update, but same problem I got a look in the plugin code and saw there was lines to set headers in right_time_context/controller.py file, to set headers, before sending the request:
the problem is either in requests.get(), or tenant & service_path are not taken from resource object ? strange...