MXS-1300: Take the refactored core into use

The refactored maxctrl function is now in use.
This commit is contained in:
Markus Mäkelä
2017-07-15 06:59:49 +03:00
parent b98b326bba
commit 3255d58e70
18 changed files with 178 additions and 122 deletions

View File

@ -18,12 +18,14 @@ exports.handler = function() {}
exports.builder = function(yargs) {
yargs
.command('service <name>', 'Start a service', {}, function(argv) {
maxctrl(argv)
.doRequest('services/' + argv.name + '/start', null, {method: 'PUT'})
maxctrl(argv, function(host) {
return doRequest(host, 'services/' + argv.name + '/start', null, {method: 'PUT'})
})
})
.command('monitor <name>', 'Start a monitor', {}, function(argv) {
maxctrl(argv)
.doRequest('monitors/' + argv.name + '/start', null, {method: 'PUT'})
maxctrl(argv, function(host) {
return doRequest(host, 'monitors/' + argv.name + '/start', null, {method: 'PUT'})
})
})
.usage('Usage: start <command>')
.help()