Closed lexvand closed 3 years ago
Use /api/v4/timeseries/{uuid}/events/export/
@lexvand
In case of export of multiple timeseries at the same time then how can I add multiple uuid
to the request?
@lexvand @caspervdw Hi Lex and Casper,
I have 2 questions regarding the export options for timeseries:
Previously, multiple timeseries can be exported in 1 file using this URL: https://nxt3.staging.lizard.net/api/v3/timeseries/?async=true&format=xlsx&start=1607420947511&end=1607507347511&interactive=true&uuid=4844f60c-6119-43dc-8b4a-d2c081b4316d,44efb09d-6af8-4971-8918-0025026d4e4f. However, I don't see it being supported by the new export endpoint anymore. Is it correct?
What values should I pass to the options in the export endpoint? I saw in the events
endpoint and in the design, these are the options that can be added: timestamp
, values
, validation_code
, comment
, last_modified
, detection_limit
and flag
but not sure what value should I pass into these fields. Could you please make a summary of them?
Kr, Hoan
@hoanphungt I've created a new backend issue to support this.
@lexvand Hi Lex,
I encounter a new issue with this timeseries export. The new API v4 timeseries export endpoint: /api/v4/timeseries/export/
return a task instance in API v4. However, this task instance is not registered in the inbox endpoint (probably because the inbox endpoint is only available in API v3). So, although the export task is done successfully, the inbox does not show any task to download.
Furthermore, I guess the export options modal is not necessary anymore since all the fields will be included in the export file by default. Is it correct? If this is the case, then the implementation of the timeseries export will remain the same as before.
Example:
@byrman Can the task result be made available in the inbox? Or is that something we decide to no longer do in API v4. That is in that case something to discuss.
@hoanphungt True, For Carsten it was easier to include the extra fields by default. And for the user it should make no difference. Do you need any input from Lirry concerning the workflow/design to make it work without the options?
Can the task result be made available in the inbox?
This is configurable: specify ?notify_user=True
in the request. At least, that was the intention (it should be tested though.)
@byrman @lexvand Tested and it worked. I can see the task in the inbox now.
@Derryrover Hi Tom,
Could you review this PR: https://github.com/nens/lizard-catalogue/issues/245? To test the timeseries export, it's best to use the Large N&S sample
or KNMI All
on staging. I needed to add the export task to Redux as well since it is related to the inbox. The implementation is similar to the Raster export.
Kr, Hoan
@hoanphungt
Okey looks good to merge.
I found the whole mechanism of keeping track of all the tasks a bit difficult to understand, but it was mostly already in the code before this ticket.
As I understand it timeseries exports first become part of the TimeseriesExport store, But once they are received by the inbox store, the inbox component removes them from the timeseriesExport store. Is my understanding correct?
kr Tom
@Derryrover Yes, you understand it correctly. This is because once the task reached the inbox, it means that the export task has been finished and we don't keep track of finished tasks.
The whole mechanism of keeping track of both the inbox and tasks and keeping them in sync with each other is quite shaky. We do have plan to eventually remove the inbox but use the task endpoint to show task progress. I think it will solve this issue. Anyway, for now it's still good enough.
Expand time series export functionality in time series export modal with functionality to optionally export the fields "flag", "validation_code", "comment", "last_modified" and "detection_limit"
Design: https://xd.adobe.com/view/42a1c54f-2241-4240-b933-fb5ea4aaa18a-17f2/
NOTE: The 'values' and 'timestamps' are required, so the checkboxes can't be unchecked
UPDATE: The new timeseries export endpoint already included all the export options by default. So this option modal is no longer necessary. For how to use the export endpoint, go to: https://nxt3.staging.lizard.net/api/v4/timeseries/export/