cloudcms-cli
Version:
Cloud CMS Command-Line client
49 lines (45 loc) • 1.57 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class RemoveDataStoreValueCommand extends AbstractCommand
{
constructor()
{
super({
"group": "datastore",
"name": "remove-value",
"description": "Remove a key/value from a datastore",
"schema": {
"properties": [{
"name": "datastoreTypeId",
"type": "string",
"description": "Enter the datastore type:",
"helper": "The type of the data store",
"required": true,
"args": ["type"]
}, {
"name": "datastoreId",
"type": "string",
"description": "Enter the datastore ID:",
"helper": "The ID of the data store",
"required": true,
"args": ["id"]
}, {
"name": "key",
"type": "string",
"description": "Enter the key:",
"helper": "The key to retrieve",
"required": true,
"args": ["key", "k"]
}]
}
});
}
handle(options, callback)
{
// call workhorse function
helper.removeDatastoreValue(options.datastoreTypeId, options.datastoreId, options.key, function(err) {
callback(err);
});
}
}
module.exports = RemoveDataStoreValueCommand;