Added demo webhook poster
This commit is contained in:
parent
7770f7b9b0
commit
8dc20b2d7d
|
@ -0,0 +1,21 @@
|
|||
import json
|
||||
import requests
|
||||
import time
|
||||
|
||||
address = "localhost/foo"
|
||||
|
||||
while True:
|
||||
t = random.uniform(100, 10000)
|
||||
body = {'VM Create time': '{}'.format(t),
|
||||
'units': 'ms'}
|
||||
headers = {'content-type': 'application/json'}
|
||||
|
||||
try:
|
||||
requests.post(url=address,
|
||||
data=json.dumps(body),
|
||||
headers=headers,
|
||||
timeout="10")
|
||||
except Exception:
|
||||
print("unable to post")
|
||||
|
||||
time.sleep(random.randint(5, 20))
|
Loading…
Reference in New Issue