[ACME, Watchdog, DockerAPI] Use only limited Docker API

This commit is contained in:
andryyy
2017-10-06 13:32:49 +02:00
parent 3ae0b16845
commit ef9953898c
4 changed files with 16 additions and 12 deletions

View File

@@ -41,6 +41,14 @@ class container_post(Resource):
return 'Error'
else:
return 'OK'
elif post_action == 'restart':
try:
for container in docker_client.containers.list(all=True, filters={"id": container_id}):
container.restart()
except:
return 'Error'
else:
return 'OK'
else:
return jsonify(message='Invalid action')
else: