Model/applications/magic_plan/local_handler/invoke_local_lambda.py

36 lines
1 KiB
Python

#!/usr/bin/env python3
import json
import requests
HOST = "localhost"
PORT = "9000"
LAMBDA_URL = f"http://{HOST}:{PORT}/2015-03-31/functions/function/invocations"
payload = {
"Records": [
{
"messageId": "test-message-id",
"body": json.dumps(
{
# "task_id": "00000000-0000-0000-0000-000000000001",
# "sub_task_id": "00000000-0000-0000-0000-000000000002",
"address": "63 Dunkery Road, Wythenshawe, M22 0WR | EPC",
"hubspot_deal_id": "501851906250",
}
# {
# "task_id": "00000000-0000-0000-0000-000000000001",
# "sub_task_id": "00000000-0000-0000-0000-000000000002",
# "address": "33 Wallaby Way, Sydney",
# "hubspot_deal_id": "123456789",
# }
),
}
]
}
response = requests.post(LAMBDA_URL, json=payload)
print("Status code:", response.status_code)
print("Response:")
print(response.text)