Added Check and Alert models and updated ReadMe
This commit is contained in:
1 parent
b945c73c87
commit
36936266ac
3 files changed
+85
No files matched your search
@@ -0,0 +1,28 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const AlertSchema = mongoose.Schema(
|
||||
{
|
||||
checkId: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'Check',
|
||||
immutable: true,
|
||||
},
|
||||
status: {
|
||||
type: Boolean,
|
||||
},
|
||||
message: {
|
||||
type: String,
|
||||
},
|
||||
notifiedStatus: {
|
||||
type: Boolean,
|
||||
},
|
||||
acknowledgeStatus: {
|
||||
type: Boolean,
|
||||
}
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model('Alert', AlertSchema);
|
||||
@@ -0,0 +1,28 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const CheckSchema = mongoose.Schema(
|
||||
{
|
||||
monitorId: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'Monitor',
|
||||
immutable: true,
|
||||
},
|
||||
status: {
|
||||
type: Boolean,
|
||||
},
|
||||
responseTime: {
|
||||
type: Number, // milliseconds
|
||||
},
|
||||
statusCode: {
|
||||
type: Number, // 200, ... , 500
|
||||
},
|
||||
message: {
|
||||
type: String,
|
||||
}
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model('Check', CheckSchema);
|
||||
Reference in new issue
Block a user