File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ # import json
2
+
3
+ # def lambda_handler(event, context):
4
+ # # TODO implement
5
+ # return {
6
+ # 'statusCode': 200,
7
+ # 'body': json.dumps('Hello from Lambda!')
8
+ # }
9
+
1
10
import json
2
11
import boto3
3
12
10
19
11
20
def lambda_handler (event , context ):
12
21
#Read postId from event
22
+ print (event )
13
23
jobId = event ['jobId' ]
14
-
24
+ print ( 'jobId' , jobId )
15
25
#check if item exists and get corresponting item or throw error
16
26
try :
17
27
response = dynamodb .get_item (
18
- TableName = 'biosteamResults ' ,
28
+ TableName = 'biosteam-results ' ,
19
29
Key = {
20
30
'jobId' : {'S' : jobId }
21
31
}
22
32
)
33
+
23
34
item = response ['Item' ]
24
35
except :
25
36
item = "no data"
26
-
37
+ print ( 'item ' , item )
27
38
return {
28
39
'statusCode' : 200 ,
29
40
"headers" : {
@@ -35,4 +46,4 @@ def lambda_handler(event, context):
35
46
'item' : item ,
36
47
'jobId' : jobId ,
37
48
})
38
- }
49
+ }
You can’t perform that action at this time.
0 commit comments