cloudcms-cli
Version:
Cloud CMS Command-Line client
38 lines (33 loc) • 993 B
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class ListJobsCommand extends AbstractCommand
{
constructor()
{
super({
"group": "platform",
"name": "list-jobs",
"description": "Lists the jobs on your platform",
"schema": {
"properties": [{
"name": "state",
"type": "string",
"description": "The state of the job ('RUNNING', 'FINISHED', 'ERROR', 'WAITING', 'AWAITING')",
"required": false,
"args": ["state", "s"]
}]
}
});
}
handle(options, callback)
{
if (options.state) {
options.state = options.state.toUpperCase();
}
// call workhorse function
helper.listJobs(options.state, function(err) {
callback(err);
});
}
}
module.exports = ListJobsCommand;