UNPKG

cloudcms-cli

Version:
49 lines (45 loc) 1.56 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class GetDataStoreValueCommand extends AbstractCommand { constructor() { super({ "group": "datastore", "name": "get-value", "description": "Gets 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.getDatastoreValue(options.datastoreTypeId, options.datastoreId, options.key, function(err) { callback(err); }); } } module.exports = GetDataStoreValueCommand;