MXS-1390: Add detailed MaxCtrl documentation

Added a more detailed description for commands that needed it.
This commit is contained in:
Markus Mäkelä
2017-09-06 10:36:32 +03:00
parent f189de47a3
commit c8490df566
16 changed files with 241 additions and 53 deletions

View File

@ -17,7 +17,9 @@ exports.desc = 'Call module commands'
exports.handler = function() {}
exports.builder = function(yargs) {
yargs
.command('command <module> <command> [parameters...]', 'Call a module command', {}, function(argv) {
.command('command <module> <command> [params...]', 'Call a module command', function(yargs) {
return yargs.epilog('To inspect the list of module commands, execute `list commands`');
}, function(argv) {
// First we have to find the correct method to use
maxctrl(argv, function(host) {
return doRequest(host, 'maxscale/modules/' + argv.module + '/', function(resp) {
@ -31,7 +33,7 @@ exports.builder = function(yargs) {
}
})
return doAsyncRequest(host, 'maxscale/modules/' + argv.module + '/' + argv.command + '?' + argv.parameters.join('&'),
return doAsyncRequest(host, 'maxscale/modules/' + argv.module + '/' + argv.command + '?' + argv.params.join('&'),
function(resp) {
return JSON.stringify(resp, null, 4)
}, { method: verb })