Esempio n. 1
0
    onlyif.rootInSmartosGlobal(function (err) {
        if (err) {
            console.error('FATAL: cannot run: %s', err);
            return process.exit(2);
        }

        cmdln.main(Fwadm);
    });
Esempio n. 2
0
	    help: 'shards for indexing tier'
	}, {
	    names: [ 'm' ],
	    type: 'string',
	    help: 'shard for marlin job records'
	}, {
	    names: [ 's' ],
	    type: 'string',
	    help: 'shard for minnow (manta_storage) records'
	}
];
Shardadm.prototype.do_set.help = (
	'Set Manta shards.\n'
	+ '\n'
	+ 'Usage:\n'
	+ '     manta-shardadm set [OPTIONS] \n'
	+ '\n'
	+ '{{options}}'
);

/*
 * If the specified string doesn't already contain the specified suffix, add it.
 */
function addSuffix(str, suffix) {
	return (str.indexOf(suffix, str.length - suffix.length) === -1 ?
	    str + suffix : str);
}


cmdln.main(Shardadm);
Esempio n. 3
0
    if (!args[0]) {
        callback(new Error('Must specify VM UUID'));
        return;
    }

    CONFIG.vmapi.agent = false;
    var vmapi = new VMAPI(CONFIG.vmapi);
    vmapi.getVm({ uuid: args[0] }, function (err, vm) {
        if (err) {
            return callback(err);
        }

        var update = {
            uuid: vm.uuid,
            nics: vm.nics,
            server_uuid: vm.server_uuid,
            tags: vm.tags,
            type: 'vm.update'
        };

        return self.fwapi.post('/updates', update,
            standardHandler.bind(null, opts));
    });
};

FwapiCLI.prototype['do_update-vm'].help =
    'Push a VM update with current data from VMAPI';


cmdln.main(FwapiCLI);
Esempio n. 4
0
		});
		process.stdin.on('end', function () {
			if (calledBack)
				return;
			calledBack = true;
			parseInput(content, cb);
		});
		process.stdin.on('error', function (err) {
			if (calledBack)
				return;
			calledBack = true;
			cb(err);
		});
		process.stdin.resume();
	}
}

function parseInput(input, cb) {
	var changes = null;
	try {
		changes = JSON.parse(input);
	} catch (e) {
		return (cb(new Error('input is invalid JSON')));
	}

	return (cb(null, changes));
}


cmdln.main(Sapiadm);
Esempio n. 5
0
        type: 'bool',
        help: 'Emit status to stdout as a JSON object.'
    },
    {
        names: [ 'dryrun', 'n' ],
        type: 'bool',
        help: 'Do not copy files, just determine what action is required' +
          ' to update the USB key.'
    },
    {
        names: [ 'ignore-missing', 'i' ],
        type: 'bool',
        help: 'In the event that the system does not have a USB key, report ' +
          ' success instead of an error.  All other errors are still fatal.'
    }
];
Usbkey.prototype.do_update.help = [
    'Update the files stored on the USB key.',
    '',
    'Usage:',
    '     sdc-usbkey update [OPTIONS]',
    '',
    '{{options}}'
].join('\n');

if (require.main === module) {
    mod_cmdln.main(Usbkey);
}

/* vim: set ts=4 sts=4 sw=4 et: */
Esempio n. 6
0
(function main() {
    cmdln.main(AmonAdm);
})();
Esempio n. 7
0
{
	var selected, c, i;

	selected = [];
	for (i = 0; i < columns.length; i++) {
		c = columns[i].split(',');
		selected = selected.concat(columns[i].split(','));
	}

	for (i = 0; i < selected.length; i++) {
		c = selected[i];
		if (allowed.indexOf(c) == -1)
			return (new VError('unknown column: "%s"', c));
	}

	return (selected);
}

function fatal(msg)
{
	console.error('%s: %s', maArg0, msg);
	process.exit(1);
}

process.stdout.on('error', function (err) {
	if (err.code == 'EPIPE')
		process.exit(0);
	throw (err);
});
cmdln.main(MantaAdm);
Esempio n. 8
0
            });
        }
    ]}, function (err) {
        if (err) {
            console.error(err);
        }
    });
    return (undefined);
};
Fash.prototype.do_diff.options = [{
    names: ['b', 'backend'],
    type: 'string',
    help: 'the backend to use'
}];
Fash.prototype.do_diff.help = (
    'compare two topologies'
    + '\n'
    + 'usage:\n'
    + '     fash diff [options] FILE1 FILE2\n'
    + '     cat ring1.json | fash diff - ring2.json\n'
    + '     fash diff -b leveldb ring1.json ring2.json\n'
    + '\n'
    + '{{options}}'
    + '\n'
    + 'If FILE1 or FILE2 is \'-\', read standard input (in memory only).\n'
    + 'You can use different backends for each input by specifying -b twice:\n'
    + '    fash diff -b leveldb -b memory leveldbdir ring.json'
);

cmdln.main(Fash); // mainline
Esempio n. 9
0
	fields = Object.keys(svcAdd);
	fields.forEach(function (field) {
		if (svcAdd[field] === undefined)
			return;
		fprintf(sout, '\t%s : %s\n', field,
		    formatValue(svcAdd[field]));
	});
	if (fields.length === 0)
		fprintf(sout, '\t(none)\n');

	fprintf(sout, '\n remove fields (if present) below:\n\n');
	fields = Object.keys(svcRemove);
	fields.forEach(function (field) {
		if (svcRemove[field] === undefined)
			return;
		fprintf(sout, '\t%s : %s\n', field,
		    formatValue(svcRemove[field]));
	});
	if (fields.length === 0)
		fprintf(sout, '\t(none)\n\n');
}

function fatal(msg)
{
	console.error('%s: %s', maGcCfgArg0, msg);
	process.exit(1);
}

cmdutil.exitOnEpipe();
cmdln.main(MantaGcConfigAdm);