Added report generator for thingsboard
This commit is contained in:
42
Report Generator/lambda-python3.12/tbreport/app.py
Normal file
42
Report Generator/lambda-python3.12/tbreport/app.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import json
|
||||
|
||||
# import requests
|
||||
|
||||
|
||||
def lambda_handler(event, context):
|
||||
"""Sample pure Lambda function
|
||||
|
||||
Parameters
|
||||
----------
|
||||
event: dict, required
|
||||
API Gateway Lambda Proxy Input Format
|
||||
|
||||
Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format
|
||||
|
||||
context: object, required
|
||||
Lambda Context runtime methods and attributes
|
||||
|
||||
Context doc: https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
|
||||
|
||||
Returns
|
||||
------
|
||||
API Gateway Lambda Proxy Output Format: dict
|
||||
|
||||
Return doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html
|
||||
"""
|
||||
|
||||
# try:
|
||||
# ip = requests.get("http://checkip.amazonaws.com/")
|
||||
# except requests.RequestException as e:
|
||||
# # Send some context about this error to Lambda Logs
|
||||
# print(e)
|
||||
|
||||
# raise e
|
||||
|
||||
return {
|
||||
"statusCode": 200,
|
||||
"body": json.dumps({
|
||||
"message": "hello world",
|
||||
# "location": ip.text.replace("\n", "")
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user