MXS-1300: Add create/destroy/list commands for users
Users can now be listed, created and destroyed via MaxCtrl.
This commit is contained in:
parent
b0f2d02787
commit
a0e7a97729
@ -159,6 +159,20 @@ exports.builder = function(yargs) {
|
||||
|
||||
doRequest('services/' + argv.service + '/listeners', null, {method: 'POST', body: listener})
|
||||
})
|
||||
.command('user <name> <password>', 'Create a new network user', {}, function(argv) {
|
||||
|
||||
var user = {
|
||||
'data': {
|
||||
'id': argv.name,
|
||||
'type': 'inet',
|
||||
'attributes': {
|
||||
'password': argv.password
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doRequest('users/inet', null, {method: 'POST', body: user})
|
||||
})
|
||||
|
||||
.usage('Usage: create <command>')
|
||||
.help()
|
||||
|
@ -26,6 +26,9 @@ exports.builder = function(yargs) {
|
||||
.command('listener <service> <name>', 'Destroy an unused listener', {}, function(argv) {
|
||||
doRequest('services/' + argv.service + '/listeners/' + argv.name, null, {method: 'DELETE'})
|
||||
})
|
||||
.command('user <name>', 'Remove a network user', {}, function(argv) {
|
||||
doRequest('users/inet/' + argv.name, null, {method: 'DELETE'})
|
||||
})
|
||||
.usage('Usage: destroy <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
|
@ -65,6 +65,11 @@ exports.builder = function(yargs) {
|
||||
{'Version': 'attributes.version'}
|
||||
])
|
||||
})
|
||||
.command('users', 'List created network users', {}, function() {
|
||||
getCollection('users/inet',[
|
||||
{'Name':'id'}
|
||||
])
|
||||
})
|
||||
.usage('Usage: list <command>')
|
||||
.help()
|
||||
.command('*', 'the default command', {}, () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user