runner: add startAllProcesses API.

parent a3852b8d
......@@ -460,6 +460,13 @@ def svcStopAll(config):
except:
pass
def svcStartAll(config):
"""Start all Instance processes on this computer"""
try:
return Popen([config['slapos'], 'node', 'supervisorctl', '--cfg', config['configuration_file_path'],
'start', 'all']).communicate()[0]
except:
pass
def removeInstanceRoot(config):
"""Clean instance directory and stop all its running processes"""
......
......@@ -30,7 +30,7 @@ from slapos.runner.utils import (checkSoftwareFolder, configNewSR,
saveSession, saveBuildAndRunParams,
setMiniShellHistory,
stopProxy,
svcStartStopProcess, svcStopAll, tail,
svcStartStopProcess, svcStartAll, svcStopAll, tail,
updateInstanceParameter)
from slapos.runner.fileBrowser import FileBrowser
......@@ -252,6 +252,9 @@ def stopAllPartition():
svcStopAll(app.config)
return redirect(url_for('inspectInstance'))
def startAllPartition():
svcStartAll(app.config)
return redirect(url_for('inspectInstance'))
def tailProcess(process):
return render_template('processTail.html',
......@@ -792,6 +795,8 @@ app.add_url_rule("/getFileLog", 'getFileLog', getFileLog,
methods=['POST'])
app.add_url_rule('/stopAllPartition', 'stopAllPartition',
stopAllPartition, methods=['GET'])
app.add_url_rule('/startAllPartition', 'startAllPartition',
startAllPartition, methods=['GET'])
app.add_url_rule('/tailProcess/name/<process>', 'tailProcess',
tailProcess, methods=['GET'])
app.add_url_rule('/startStopProccess/name/<process>/cmd/<action>',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment