insight/src/Core/Insight.Infrastructure/Entities/Host/HostSystem.cs

39 lines
1.1 KiB
C#
Raw Normal View History

2023-09-21 18:58:32 +02:00
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
2023-11-17 17:12:41 +01:00
using MongoDB.Driver;
2023-09-21 18:58:32 +02:00
using System.Text.Json.Serialization;
2023-09-22 22:16:56 +02:00
namespace Insight.Infrastructure.Entities;
2023-11-17 17:12:41 +01:00
public static partial class MongoDatabaseExtensions
{
public static IMongoCollection<HostSystemEntity> HostSystem(this IMongoDatabase database) => database.GetCollection<HostSystemEntity>("host_sys");
}
2023-09-22 22:16:56 +02:00
[BsonIgnoreExtraElements]
public class HostSystemEntity
2023-09-21 18:58:32 +02:00
{
2023-09-22 22:16:56 +02:00
[BsonId, BsonRepresentation(BsonType.ObjectId), JsonPropertyName("id")]
public string? Id { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("_host"), BsonRepresentation(BsonType.ObjectId), JsonPropertyName("host")]
public string? Host { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("insert")]
public DateTime? Insert { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("update")]
public DateTime? Update { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("localtime")]
public DateTime? LocalTime { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("bootuptime")]
public DateTime? BootUpTime { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("processes")]
public uint? Processes { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("license")]
public string? License { get; set; }
2023-09-21 18:58:32 +02:00
}