generated from NASA-AMMOS/slim-starterkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from unity-sds/413-submit-ogc
Add SRL Initiator for EDRGen and New OGC Action Type
- Loading branch information
Showing
41 changed files
with
254 additions
and
131 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
50 changes: 50 additions & 0 deletions
50
src/unity_initiator/actions/submit_ogc_process_execution.py
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import httpx | ||
|
||
from ..utils.logger import logger | ||
from .base import Action | ||
|
||
__all__ = ["SubmitOgcProcessExecution"] | ||
|
||
|
||
class SubmitOgcProcessExecution(Action): | ||
def __init__(self, payload, payload_info, params): | ||
super().__init__(payload, payload_info, params) | ||
logger.info("instantiated %s", __class__.__name__) | ||
|
||
def execute(self): | ||
logger.debug("executing execute in %s", __class__.__name__) | ||
url = f"{self._params['ogc_processes_base_api_endpoint']}/processes/{self._params['process_id']}/execution" | ||
logger.info("url: %s", url) | ||
headers = {"Content-Type": "application/json", "Accept": "application/json"} | ||
# body = { | ||
# "inputs": self._params["execution_inputs"], | ||
# "outputs": self._params["execution_outputs"], | ||
# "subscriber": self._params["execution_subscriber"], | ||
# } | ||
body = { | ||
"inputs": { | ||
"payload": self._payload, | ||
"payload_info": self._payload_info, | ||
"on_success": self._params["on_success"], | ||
}, | ||
"outputs": None, | ||
"subscriber": None, | ||
} | ||
response = httpx.post(url, headers=headers, json=body, verify=False) # nosec | ||
if response.status_code in (200, 201): | ||
success = True | ||
resp = response.json() | ||
logger.info( | ||
"Successfully triggered the execution of the OGC Process %s: %s", | ||
self._params["process_id"], | ||
resp, | ||
) | ||
else: | ||
success = False | ||
resp = response.text | ||
logger.info( | ||
"Failed to trigger the execution of the OGC Process %s: %s", | ||
self._params["process_id"], | ||
resp, | ||
) | ||
return {"success": success, "response": resp} |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...unity/triggers/scheduled_task/versions.tf → ...ity/evaluators/sns-sqs-lambda/versions.tf
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,5 +1,5 @@ | ||
terraform { | ||
required_version = "~> 1.4.6" | ||
required_version = "~> 1.8.2" | ||
|
||
required_providers { | ||
archive = { | ||
|
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
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,5 +1,5 @@ | ||
terraform { | ||
required_version = "~> 1.4.6" | ||
required_version = "~> 1.8.2" | ||
|
||
required_providers { | ||
aws = { | ||
|
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
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,5 +1,5 @@ | ||
terraform { | ||
required_version = "~> 1.4.6" | ||
required_version = "~> 1.8.2" | ||
|
||
required_providers { | ||
archive = { | ||
|
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...m-unity/triggers/scheduled_task/locals.tf → ...m-unity/triggers/scheduled-task/locals.tf
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
File renamed without changes.
5 changes: 0 additions & 5 deletions
5
...nity/triggers/scheduled_task/variables.tf → ...nity/triggers/scheduled-task/variables.tf
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
2 changes: 1 addition & 1 deletion
2
...ity/evaluators/sns_sqs_lambda/versions.tf → ...unity/triggers/scheduled-task/versions.tf
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,5 +1,5 @@ | ||
terraform { | ||
required_version = "~> 1.4.6" | ||
required_version = "~> 1.8.2" | ||
|
||
required_providers { | ||
archive = { | ||
|
Oops, something went wrong.