67 lines
1.3 KiB
JavaScript
67 lines
1.3 KiB
JavaScript
const mongoose = require('mongoose');
|
|
mongoose.set('useFindAndModify', false);
|
|
//mongoose.set('debug', true)
|
|
|
|
const provisionSchema = new mongoose.Schema({
|
|
user: {
|
|
type: mongoose.Types.ObjectId, ref: 'User',
|
|
index: true
|
|
},
|
|
created: {
|
|
type: Date,
|
|
default: Date.now
|
|
},
|
|
updated: {
|
|
type: Date,
|
|
default: Date.now
|
|
},
|
|
scenario: String,
|
|
description: String,
|
|
vmImage: Object,
|
|
vmType: String,
|
|
nodeCount: Number,
|
|
status: {
|
|
type: String,
|
|
default: "queued"
|
|
},
|
|
jobId: String,
|
|
logFile: String,
|
|
outputs: Object,
|
|
path: String,
|
|
isDestroyed: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
isDeleted: {
|
|
type: Boolean,
|
|
default: false,
|
|
index: true
|
|
},
|
|
statusVms: {
|
|
type: String,
|
|
default: "Running"
|
|
},
|
|
destroy: {
|
|
type: mongoose.Types.ObjectId, ref: 'Destroy'
|
|
},
|
|
runningFrom: {
|
|
type: Date
|
|
},
|
|
stoppedFrom: {
|
|
type: Date
|
|
},
|
|
timeRunning: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
countExtend: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
pendingNextAction: {
|
|
type: String
|
|
}
|
|
});
|
|
|
|
|
|
module.exports = mongoose.model('Provision', provisionSchema) |