UNPKG

cloudcms-cli

Version:
59 lines (55 loc) 2.13 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class ImportPlatformDataStoreCommand extends AbstractCommand { constructor() { super({ "group": "admin", "name": "import-platform-datastore", "description": "Imports a datastore to a platform after mongorestore", "schema": { "properties": [{ "name": "platformId", "type": "string", "description": "Enter the platform ID", "required": true, "args": ["platformId", "platform"] }, { "name": "datastoreTypeId", "type": "string", "description": "Enter the data store type ID", "required": true, "args": ["datastoreTypeId", "type"] }, { "name": "datastoreId", "type": "string", "description": "Enter the data store ID", "required": true, "args": ["datastoreId", "id"] }, { "name": "username", "type": "string", "description": "Admin username", "required": true, "args": ["username", "u"] }, { "name": "password", "type": "string", "description": "Admin password", "required": true, "hidden": true, "args": ["password", "p"] }] } }); } handle(options, callback) { // call workhorse function helper.importPlatformDataStore(options.platformId, options.datastoreTypeId, options.datastoreId, options.sourceEnvironmentId, options.targetEnvironmentId, options.overwrite, options.username, options.password, function(err, job) { callback(err); }); } } module.exports = ImportPlatformDataStoreCommand;