diff --git a/README.md b/README.md index 565e3ccf11ea71a23258f59898fa1d7ff24289de..f150411a3a307a83e3cc07120905e0108e51e1aa 100644 --- a/README.md +++ b/README.md @@ -126,3 +126,90 @@ Log into the ldv-specification container. (using the portainer GUI or with the d *** +## Usage + +See also: + * https://support.astron.nl/confluence/display/SDCP/API+dynamics + +### Add a work specification + +With this url you can specify work + * http://127.0.0.1:8000/ldvspec/api/v1/workspecification/ + +This is an example of structure of the LOFAR data in the `ldv-spec-db` database. +Which also shows which fields can be used to filter on. + * http://127.0.0.1:8000/ldvspec/api/v1/data/ + +``` +GET /ldvspec/api/v1/data/ +HTTP 200 OK +Allow: GET, POST, HEAD, OPTIONS +Content-Type: application/json +Vary: Accept + +{ + "count": 10010, + "next": "http://127.0.0.1:8000/ldvspec/api/v1/data/?page=2", + "previous": null, + "results": [ + { + "id": 3155, + "obs_id": "102092", + "oid_source": "SAS", + "dataproduct_source": "LOFAR LTA", + "dataproduct_type": "Correlator data", + "project": "LC0_043", + "activity": "Raw Observation", + "surl": "srm://lofar-srm.fz-juelich.de:8443/pnfs/fz-juelich.de/data/lofar/ops/projects/lc0_043/102092/L102092_SAP000_SB261_uv.MS_8d9ea7c0.tar", + "filesize": 1477939200, + "additional_meta": "{'dysco_compression': False}", + "location": "Juelich" + }, +``` + +- Enter the filter in json format in the `filter` textbox, for example `{"obs_id": 102092, "additional_meta__dysco_compression": true}` +- Choose valid workflow, for example `imaging_compress_pipeline_v02` +(see the worklows endpoint in the ATDB API for an overview of valid workflows: https://sdc.astron.nl:5554/atdb/workflows/) + +- After clicking 'POST', the response should look like this. + +``` +HTTP 201 Created +Allow: GET, POST, HEAD, OPTIONS +Content-Type: application/json +Vary: Accept + +{ + "id": 2, + "created_on": "2022-08-15T07:07:39.479546Z", + "filters": { + "obs_id": 102092, + "additional_meta__dysco_compression": true + }, + "inputs": null, + "selected_workflow": "imaging_compress_pipeline_v02", + "related_tasks": null, + "is_ready": false, + "is_defined": false, + "async_task_result": "99622e7b-71f0-4f05-826d-23c13846642d", + "created_by": 1, + "processing_site": null +} +``` + +The workspecification endpoint now shows an overview of specified work, which is ready to be sent to ATDB-LDV: + * http://127.0.0.1:8000/ldvspec/api/v1/workspecification/ + + +### Troubleshooting +*Q: OperationalError at /ldvspec/api/v1/workspecification/* [WinError 10061] No connection could be made because the target machine actively refused it + +A: make sure that you have a connection to a celery broker (RabbitMQ) when running the application in development mode. + +Example on Windows machine: +``` +SET CELERY_BROKER_URL=amqp://guest@raspiastro:5672 +python manage.py runserver --settings=ldvspec.settings.dev +``` + +--- \ No newline at end of file diff --git a/ldvspec/lofardata/templates/lofardata/index.html b/ldvspec/lofardata/templates/lofardata/index.html index 98e5e9f5e6073ba4ab8145573428678760ecedd9..dd57bac1119189e47e3f8799e491b65b2154883e 100644 --- a/ldvspec/lofardata/templates/lofardata/index.html +++ b/ldvspec/lofardata/templates/lofardata/index.html @@ -25,7 +25,7 @@ </tbody> </table> - <p class="footer"> Version 1.0.0 (2 aug 2022 - 13:30) + <p class="footer"> Version 1.0.0 (15 aug 2022 - 8:00) </div>