in lambda/api/app.py [0:0]
def post_dynamo():
try:
body = app.current_event.json_body
if 'id' not in body:
body['id'] = str(uuid.uuid4())
dynamo_table.put_item(Item=body)
return {"result": body['id']}
except Exception as e:
logger.error(e)
metrics.add_metric(name='API_Error_Dynamo',
unit=MetricUnit.Count, value=1)
raise ServiceError(502, "Something went wrong! Please try again.")