-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 8670cc0997b376a3afcfdc157fbb13d1d81f7be8 Mon Sep 17 00:00:00 2001 | ||
From b7c955c9ef684bc152e8c44005f5f5df22f79b0f Mon Sep 17 00:00:00 2001 | ||
From: Bernhard Mallinger <[email protected]> | ||
Date: Wed, 12 Jul 2023 10:45:55 +0200 | ||
Subject: [PATCH] Allow specifying `job_id` via request parameter | ||
|
@@ -14,46 +14,43 @@ so I'd prefer to pass the id via POST data. This way we can treat it as | |
suggestion, or possibly as a template from which the server derives the | ||
actual id. | ||
--- | ||
pygeoapi/api.py | 3 ++- | ||
pygeoapi/process/manager/base.py | 5 +++-- | ||
2 files changed, 5 insertions(+), 3 deletions(-) | ||
pygeoapi/api.py | 2 ++ | ||
pygeoapi/process/manager/base.py | 3 ++- | ||
2 files changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git pygeoapi/api.py pygeoapi/api.py | ||
index e388275..b5449fa 100644 | ||
index 899f5ea..f410cd8 100644 | ||
--- pygeoapi/api.py | ||
+++ pygeoapi/api.py | ||
@@ -3552,6 +3552,7 @@ class API: | ||
@@ -3492,6 +3492,7 @@ class API: | ||
|
||
data_dict = data.get('inputs', {}) | ||
LOGGER.debug(data_dict) | ||
+ desired_job_id = data.get("job_id") | ||
|
||
try: | ||
execution_mode = RequestedProcessExecutionMode( | ||
@@ -3562,7 +3563,7 @@ class API: | ||
try: | ||
LOGGER.debug('Executing process') | ||
result = self.manager.execute_process( | ||
- process_id, data_dict, execution_mode=execution_mode) | ||
+ process_id, data_dict, execution_mode=execution_mode, desired_job_id=desired_job_id) | ||
subscriber = None | ||
subscriber_dict = data.get('subscriber') | ||
@@ -3523,6 +3524,7 @@ class API: | ||
data_dict, | ||
execution_mode=execution_mode, | ||
subscriber=subscriber, | ||
+ desired_job_id=desired_job_id, | ||
) | ||
job_id, mime_type, outputs, status, additional_headers = result | ||
headers.update(additional_headers or {}) | ||
headers['Location'] = f'{self.base_url}/jobs/{job_id}' | ||
diff --git pygeoapi/process/manager/base.py pygeoapi/process/manager/base.py | ||
index d0d7824..0f6d35a 100644 | ||
index 3149e73..1c80abd 100644 | ||
--- pygeoapi/process/manager/base.py | ||
+++ pygeoapi/process/manager/base.py | ||
@@ -312,7 +312,8 @@ class BaseManager: | ||
self, | ||
process_id: str, | ||
@@ -328,6 +328,7 @@ class BaseManager: | ||
data_dict: dict, | ||
- execution_mode: Optional[RequestedProcessExecutionMode] = None | ||
+ execution_mode: Optional[RequestedProcessExecutionMode] = None, | ||
+ desired_job_id: str | None = None | ||
execution_mode: Optional[RequestedProcessExecutionMode] = None, | ||
subscriber: Optional[Subscriber] = None, | ||
+ desired_job_id: str | None = None, | ||
) -> Tuple[str, Any, JobStatus, Optional[Dict[str, str]]]: | ||
""" | ||
Default process execution handler | ||
@@ -329,7 +330,7 @@ class BaseManager: | ||
@@ -345,7 +346,7 @@ class BaseManager: | ||
response | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters