cloudcms-cli
Version:
Cloud CMS Command-Line client
55 lines (51 loc) • 1.86 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class AssignCommand extends AbstractCommand
{
constructor()
{
super({
"group": "stack",
"name": "assign",
"description": "Assigns a datastore to a stack",
"schema": {
"properties": [{
"name": "stackId",
"type": "string",
"description": "Enter the stack ID:",
"helper": "The ID of the project",
"required": true,
"args": ["stackId", "stack"]
}, {
"name": "key",
"type": "string",
"description": "The unique key for the assignment",
"required": true,
"args": ["key"]
}, {
"name": "datastoreTypeId",
"type": "string",
"description": "Enter the datastore type:",
"helper": "The type of the data store",
"required": true,
"args": ["datastoreTypeId", "datastoreType", "type"]
}, {
"name": "datastoreId",
"type": "string",
"description": "Enter the datastore ID:",
"helper": "The ID of the data store",
"required": true,
"args": ["datastoreId", "datastore", "id"]
}]
}
});
}
handle(options, callback)
{
// call workhorse function
helper.assignToStack(options.stackId, options.key, options.datastoreTypeId, options.datastoreId, function(err) {
callback(err);
});
}
}
module.exports = AssignCommand;