Semaphore/lib/models/Task.js
Matej Kramny be0fc0b324 Ability to run tasks, results streamed back to the user
- Updated Readme
- Nicer overview of a playbook
2014-08-30 19:05:44 +01:00

28 lines
438 B
JavaScript

var mongoose = require('mongoose')
var ObjectId = mongoose.Schema.ObjectId;
var schema = mongoose.Schema({
created: {
type: Date,
default: Date.now
},
job: {
type: ObjectId,
ref: 'Job'
},
playbook: {
type: ObjectId,
ref: 'Playbook'
},
output: String,
status: {
type: String,
enum: ['Completed', 'Failed', 'Running', 'Queued']
}
});
schema.index({
status: 1
});
module.exports = mongoose.model('Task', schema);