Skip to content
Snippets Groups Projects
Commit f0815d08 authored by Edouard DE BRYE's avatar Edouard DE BRYE
Browse files

modified lambda for slack alerting

parent 2176d4d0
No related branches found
No related tags found
No related merge requests found
......@@ -15,15 +15,17 @@ def lambda_handler(event, context):
"\t- New State Value : "+m.get('NewStateValue')+"\n"+ \
"\t- New State Reason : "+m.get('NewStateReason')+"\n"+ \
"\t- New State Time : "+m.get('StateChangeTime')+"\n")
print("Number of messages : " +str(len(text)))
msg = {
"text": "\n-------\n".join(text)
}
encoded_msg = json.dumps(msg).encode('utf-8')
resp = http.request('POST',url, body=encoded_msg)
print(json.dumps({
"messages": messages,
ret = json.dumps({
"body": {"messages":messages},
"status_code": resp.status,
"response": resp.data.decode("utf-8")
})
)
\ No newline at end of file
})
print(ret)
return ret
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment