MXS-1973 Support reverse DNS for client hostnames in MaxCtrl

May slow maxscale down when used. Only supported for "list sessions",
"show sessions" and "show session <id>".
This commit is contained in:
Esa Korhonen
2019-05-06 18:44:23 +03:00
parent 0e0342e657
commit e3b5ba9620
9 changed files with 137 additions and 18 deletions

View File

@ -115,9 +115,15 @@ exports.builder = function(yargs) {
.command('sessions', 'List sessions', function(yargs) {
return yargs.epilog('List all client sessions.')
.usage('Usage: list sessions')
.group([rDnsOption.shortname], 'Options:')
.option(rDnsOption.shortname, rDnsOption.definition)
}, function(argv) {
maxctrl(argv, function(host) {
return getCollection(host, 'sessions',[
var resource = 'sessions'
if (argv[this.rDnsOption.shortname]) {
resource += '?' + this.rDnsOption.optionOn
}
return getCollection(host, resource,[
{'Id': 'id'},
{'User': 'attributes.user'},
{'Host': 'attributes.remote'},