forked from sebgoa/transform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.py
More file actions
29 lines (21 loc) · 680 Bytes
/
handler.py
File metadata and controls
29 lines (21 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import json
#import requests
import datetime
def endpoint(event, context):
current_time = datetime.datetime.now().time()
#print(event.keys())
# respond with a cloudevent
body = {}
body['specversion']='1.0'
body['time']='2018-04-05T03:56:24Z'
body['id']='XXX-YYY-ZZZ-WWW'
body['datacontenttype']='Content-type: application/json'
#headers = {'Content-Type': 'application/cloudevents+json'}
#body['data'] = {
# "message": "A commit was made at " + event['repository']['full_name']
#}
body['data'] = {
"message": "time is " + str(current_time)
}
response = json.dumps(body)
return response