MXS-1330: Pair header names with resource paths
The getCollection and getResource now use similar mechanisms to declare the names and values for the tables.
This commit is contained in:
@ -19,52 +19,51 @@ exports.handler = function() {}
|
||||
exports.builder = function(yargs) {
|
||||
yargs
|
||||
.command('servers', 'List servers', {}, function() {
|
||||
|
||||
getCollection('servers',
|
||||
['Server', 'Address', 'Port', 'Connections', 'Status'],
|
||||
['id',
|
||||
'attributes.parameters.address',
|
||||
'attributes.parameters.port',
|
||||
'attributes.statistics.connections',
|
||||
'attributes.status'])
|
||||
getCollection('servers', [
|
||||
{'Server': 'id'},
|
||||
{'Address': 'attributes.parameters.address'},
|
||||
{'Port': 'attributes.parameters.port'},
|
||||
{'Connections': 'attributes.statistics.connections'},
|
||||
{'Status': 'attributes.status'}
|
||||
])
|
||||
})
|
||||
.command('services', 'List services', {}, function() {
|
||||
getCollection('services',
|
||||
['Service', 'Router', 'Connections', 'Total Connections', 'Servers'],
|
||||
['id',
|
||||
'attributes.router',
|
||||
'attributes.connections',
|
||||
'attributes.total_connections',
|
||||
'relationships.servers.data[].id'])
|
||||
getCollection('services',[
|
||||
{'Service': 'id'},
|
||||
{'Router': 'attributes.router'},
|
||||
{'Connections': 'attributes.connections'},
|
||||
{'Total Connections': 'attributes.total_connections'},
|
||||
{'Servers': 'relationships.servers.data[].id'}
|
||||
])
|
||||
})
|
||||
.command('monitors', 'List monitors', {}, function() {
|
||||
getCollection('monitors',
|
||||
['Monitor', 'Status', 'Servers'],
|
||||
['id',
|
||||
'attributes.state',
|
||||
'relationships.servers.data[].id'])
|
||||
getCollection('monitors', [
|
||||
{'Monitor': 'id'},
|
||||
{'Status': 'attributes.state'},
|
||||
{'Servers': 'relationships.servers.data[].id'}
|
||||
])
|
||||
})
|
||||
.command('sessions', 'List sessions', {}, function() {
|
||||
getCollection('sessions',
|
||||
['Id', 'Service', 'User', 'Host'],
|
||||
['id',
|
||||
'relationships.services.data[].id',
|
||||
'attributes.user',
|
||||
'attributes.remote'])
|
||||
getCollection('sessions',[
|
||||
{'Id': 'id'},
|
||||
{'Service': 'relationships.services.data[].id'},
|
||||
{'User': 'attributes.user'},
|
||||
{'Host': 'attributes.remote'}
|
||||
])
|
||||
})
|
||||
.command('filters', 'List filters', {}, function() {
|
||||
getCollection('filters',
|
||||
['Filter', 'Service', 'Module'],
|
||||
['id',
|
||||
'relationships.services.data[].id',
|
||||
'attributes.module'])
|
||||
getCollection('filters', [
|
||||
{'Filter': 'id'},
|
||||
{'Service': 'relationships.services.data[].id'},
|
||||
{'Module': 'attributes.module'}
|
||||
])
|
||||
})
|
||||
.command('modules', 'List loaded modules', {}, function() {
|
||||
getCollection('maxscale/modules',
|
||||
['Module', 'Type', 'Version'],
|
||||
['id',
|
||||
'attributes.module_type',
|
||||
'attributes.version'])
|
||||
getCollection('maxscale/modules',[
|
||||
{'Module':'id'},
|
||||
{'Type':'attributes.module_type'},
|
||||
{'Version': 'attributes.version'}
|
||||
])
|
||||
})
|
||||
.help()
|
||||
}
|
||||
|
Reference in New Issue
Block a user