openleadr-python icon indicating copy to clipboard operation
openleadr-python copied to clipboard

Getting ven_id in the process of registering a report

Open c-zam opened this issue 3 years ago • 3 comments

Hello Stan. I have a VTN-server on which I am trying to register/update a report. If I use "compact mode" for registration I get ven_id like this:

async def on_register_report(ven_id, resource_id, measurement, unit, scale, min_sampling_interval, max_sampling_interval):
    myVenId = ven_id

But, if I use "full mode" i'm having problems:

async def on_register_report(report):
    myVenId = ???

The same situation for "on_update_report(payload)".

Maybe I'm doing something wrong or I don't understand something... Could you help me? Thanks for your work.

c-zam avatar Jun 16 '22 08:06 c-zam

Hm, that might have been an oversight. I know I added ven_id to the 'normal' report mode a while back, but I must not have added it to the full mode. I'll have to add that to the interface.

Can I ask what the reason for using the full mode is? Is there a use case that the normal mode does not cover?

stan-janssen avatar Jun 16 '22 10:06 stan-janssen

Yes, sure. I will try to explain my case. I have a NOSQL database with two tables for reports.

First table for report meta data with following columns - ven_id, report_specifier_id, measurement, unit, scale, ... If I use "normal" mode, I can't get the "report_specifier_id" parameter. If I use "full" mode, I can't get the "ven_id" parameter.

Second table for report payload with following columns - ven_id, report_specifier_id, date_time, value, ... For this table I can't get "ven_id" parameter when executing the function "on_update_report(payload)".

c-zam avatar Jun 17 '22 06:06 c-zam

I have attached the modified "report_service.py" file which helped me solve my issue. Perhaps this will be of interest to you. report_service.zip

c-zam avatar Jun 17 '22 07:06 c-zam