Updated hardware check schema to reflect new agent structure

This commit is contained in:
Alex Holliday committed 2024-11-11 08:52:34 +08:00
1 parent 957eabef23
commit d1061be028
1 file changed
+9
+9
View File
@@ -30,6 +30,11 @@ const hostSchema = mongoose.Schema({
kernel_version: { type: String, default: "" }, kernel_version: { type: String, default: "" },
}); });
const errorSchema = mongoose.Schema({
metric: { type: [String], default: [] },
err: { type: String, default: "" },
});
const HardwareCheckSchema = mongoose.Schema( const HardwareCheckSchema = mongoose.Schema(
{ {
...BaseCheckSchema.obj, ...BaseCheckSchema.obj,
@@ -49,6 +54,10 @@ const HardwareCheckSchema = mongoose.Schema(
type: hostSchema, type: hostSchema,
default: () => ({}), default: () => ({}),
}, },
errors: {
type: [errorSchema],
default: () => [],
},
}, },
{ timestamps: true } { timestamps: true }
); );