EIDA / eida-statistics

Aggregated statistics of EIDA nodes
GNU General Public License v3.0
0 stars 0 forks source link

csv file does not give back network when requested #21

Closed xrise75 closed 1 year ago

xrise75 commented 1 year ago

https://ws.resif.fr/eidaws/statistics/1//dataselect/query?start=2022-01&end=2022-12&datacenter=NOA&network=HP&aggregate_on=location,channel,month,datacenter,network,station,country&format=csv query.csv

Moreover format=text does not work. Only csv

jschaeff commented 1 year ago

If you aggregate on networks, you will have the result for all the networks. If you want to see the statistics for each network, you need to remove the network from the "aggregate_on" parameter, which would give:

https://ws.resif.fr/eidaws/statistics/1//dataselect/query?start=2022-01&end=2022-12&datacenter=NOA&network=HP&aggregate_on=location,channel,month,datacenter,station,country&format=csv

What would you like a format text to look like ?

xrise75 commented 1 year ago

Ok my fault about the network agregation

format issue: csv is fine for me as a simple choice BUT in the builder, when I choose format Text/csv then the url has ...&format-=text instead of csv and does not work

jschaeff commented 1 year ago

OK, nice catch, this is a bug. @vpet98 will fix it.

vpet98 commented 1 year ago

Thank you for the note,

Bug is fixed on main branch. Needs to be deployed again I suppose.

jschaeff commented 1 year ago

@vpet98 if the value of format is not supported, the webservice should reply a better error message. For now, it says if format=text:

http "http://ws-staging.resif.fr/eidaws/statistics/1/dataselect/query?start=2022-01&end=2022-02&aggregate_on=month,datacenter,country,network,station,location,channel&format=text"
HTTP/1.1 400 BAD REQUEST
content-length: 48
content-type: text/plain
date: Tue, 24 Jan 2023 14:50:43 GMT

BAD REQUEST: invalid value of parameter 'format'

could you fix it ?

vpet98 commented 1 year ago

Yes, I can, but what we would like to reply in this case? Maybe print the wrong value as well?

jschaeff commented 1 year ago

something like "Unsupported value for parameter format." would do, I guess ?

vpet98 commented 1 year ago

Done!

xrise75 commented 1 year ago

Not fixed yet! still when in query form I click format text/csv then the url given has "&format=text" instead of "&format=csv"

vpet98 commented 1 year ago

The code is fixed. New version is not deployed yet. I suppose it will be deployed soon together with some other fixes which are in progress.

jschaeff commented 1 year ago

Fix deployed. Thank you @vpet98