adding post memo to api

This commit is contained in:
jbruce12000 2022-05-29 12:21:32 -04:00
parent 50f48cae78
commit df7c550ab1
2 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,10 @@ stop a schedule
curl -d '{"cmd":"stop"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
post a memo
curl -d '{"cmd":"memo", "memo":"some significant message"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
stats for currently running schedule
curl -X GET http://0.0.0.0:8081/api/stats

View File

@ -86,6 +86,11 @@ def handle_api():
log.info("api stop command received")
oven.abort_run()
if bottle.request.json['cmd'] == 'memo':
log.info("api memo command received")
memo = bottle.request.json['memo']
log.info("memo=%s" % (memo))
# get stats during a run
if bottle.request.json['cmd'] == 'stats':
log.info("api stats command received")