UNPKG

sendak

Version:

Sendak manages metadata for cloud deployments

56 lines (45 loc) 1.51 kB
'use strict'; var meta = function () { return { 'args' : { 'create-iam-user' : [ Boolean, 'Specify that you would like an IAM user created.' ], 'with-vpc' : [ String, 'Specify a VPC to which this user should have access.' ], 'user-name' : [ String, 'Specify the username' ], 'name' : [ String, 'Specify the person\'s (given, sur) name' ], 'dry-run' : [ Boolean, 'don\'t actually do it.' ] }, 'name' : 'create-sendak-user', 'abstract' : 'creates a new user in the Sendak metadata store' } }; /* This tool goes and grabs the prototype for 'user' from Riak, and inserts the values for this user supplied on the commandline. If correct flags are specified, this Sendak user will also be given a new account in AWS. These flags are (probably): --create-iam-user --with-vpc --user-name */ var plug = function (args) { var Sendak = require( '../../lib/js/sendak.js' ) , rm = Sendak.rm , stdout = Sendak.stdout , stderr = Sendak.stderr , logger = Sendak.getlogger() if (args['user-name']) { logger.debug( 'attempting to create new user '.concat( args['user-name'] ) ); Sendak.users.sendak.create( args ).then( function (user) { logger.info( 'user created'.concat( ' ', user['user-name'], ' (', user['serial'], ')' ) ); } ); } else { stderr( 'You need to provide a user name.' ); process.exit( -255 ); } } module.exports = plug; plug.meta = meta; // jane@cpan.org // vim:tw=80:ts=2:noet