diff --git a/src/unity_initiator/actions/submit_hysds_job.py b/src/unity_initiator/actions/submit_hysds_job.py index 874b8ae..1f89103 100644 --- a/src/unity_initiator/actions/submit_hysds_job.py +++ b/src/unity_initiator/actions/submit_hysds_job.py @@ -21,7 +21,7 @@ def execute(self): job_params = { "payload": self._payload, "payload_info": self._payload_info, - "on_success": self._params["on_success"], + "on_success": self._params.get("on_success", None), } # setup url and request body diff --git a/tests/resources/test_router.yaml b/tests/resources/test_router.yaml index e1e09df..0d65388 100644 --- a/tests/resources/test_router.yaml +++ b/tests/resources/test_router.yaml @@ -150,7 +150,7 @@ initiator_config: actions: - name: submit_hysds_job params: - mozart_base_api_endpoint: https://example.com/api/v0.1/job/submit + mozart_base_api_endpoint: https://example.com/mozart/api/v0.1/job/submit job_spec: submit_airs_ingest:v1 queue: ingest_queue priority: 0 @@ -172,3 +172,44 @@ initiator_config: - name: submit_ogc_process_execution params: process_id: hello_world + + # ECMWF A2/A3 + - regexes: + - '/(?P(?PECMWF)_(?PA2A3)_(?P\d{4})(?P\d{2})(?P\d{2})(?P\d{2})(?P\d{2})_(?P\d{4})(?P\d{2})(?P\d{2})(?P\d{2})(?P\d{2})_(?P\d+)\.json)$' + evaluators: + + # If the regex matches, the router submits a convert_merge_a2_a3 HySDS job that contains + # the payload and the regex match groupdict() as JSON. + - name: convert_merge_a2_a3 + actions: + - name: submit_hysds_job + params: + mozart_base_api_endpoint: https://example.com/mozart/api/v0.1/job/submit + job_spec: job-convert_merge_a2_a3:r4.0.4 + queue: factotum-ecmwf-licensed-worker-1 + priority: 0 + tags: + - ecmwf + - a2 + - a3 + - hysds + + # ECMWF A4 + - regexes: + - '/(?P(?PECMWF)_(?PA4)_(?P\d{4})(?P\d{2})(?P\d{2})(?P\d{2})(?P\d{2})_(?P\d{4})(?P\d{2})(?P\d{2})(?P\d{2})(?P\d{2})_(?P\d+)\.json)$' + evaluators: + + # If the regex matches, the router submits a convert_a4 HySDS job that contains + # the payload and the regex match groupdict() as JSON. + - name: convert_a4 + actions: + - name: submit_hysds_job + params: + mozart_base_api_endpoint: https://example.com/mozart/api/v0.1/job/submit + job_spec: job-convert_a4:r4.0.4 + queue: factotum-ecmwf-licensed-worker-2 + priority: 0 + tags: + - ecmwf + - a4 + - hysds