Created
November 25, 2020 01:25
-
-
Save jhidajat/ee42db434a1eed159d3ab051cba0f71f to your computer and use it in GitHub Desktop.
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
from botocore.vendored import requests | |
def lambda_handler(event, context): | |
API_ENDPOINT_URL = event.get('api_endpoint_url') | |
DATA = event.get('data') | |
S3_BUCKET = event.get('s3_bucket') | |
S3_FILE_OBJECT_DIR_KEY = event.get('s3_file_object_dir_key') | |
PROJECT_ID = event.get('project_id') | |
JOB_ID = event.get('job_id') | |
OCTOPUS_SERVER_URL = event.get('octopus_server_url') | |
COMPLETED_JOB_ENDPOINT = event.get('completed_job_endpoint') | |
HEADERS = { 'Content-Type': 'application/json' } | |
analysis_response = requests.post(url=API_ENDPOINT_URL, headers=HEADERS, data=json.dumps(DATA)) | |
# TODO: PUT S3://.. | |
requests.post(url=COMPLETED_JOB_ENDPOINT, data=analysis_response.json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment