diff --git a/maxctrl/maxctrl_core/lib/create.js b/maxctrl/maxctrl_core/lib/create.js index 40a8d3064..4cacba607 100644 --- a/maxctrl/maxctrl_core/lib/create.js +++ b/maxctrl/maxctrl_core/lib/create.js @@ -82,7 +82,15 @@ exports.builder = function(yargs) { describe: 'Link the created monitor to these servers', type: 'array' }) - .command('monitor ', 'Create a new server', {}, function(argv) { + .option('monitor-user', { + describe: 'Username for the monitor user', + type: 'string' + }) + .option('monitor-password', { + describe: 'Password for the monitor user', + type: 'string' + }) + .command('monitor ', 'Create a new monitor', {}, function(argv) { var monitor = { 'data': { @@ -99,6 +107,13 @@ exports.builder = function(yargs) { } } + if (argv.monitorUser) { + _.set(monitor, 'data.attributes.parameters.user', argv.monitorUser) + } + if (argv.monitorPassword) { + _.set(monitor, 'data.attributes.parameters.password', argv.monitorPassword) + } + maxctrl(argv, function(host) { return doRequest(host, 'monitors', null, {method: 'POST', body: monitor}) }) @@ -132,7 +147,7 @@ exports.builder = function(yargs) { describe: 'TLS certificate verification depth', type: 'string' }) - .command('listener ', 'Create a new server', {}, function(argv) { + .command('listener ', 'Create a new listener', {}, function(argv) { var listener = { 'data': {