insight/src/Core/Insight.Infrastructure/Entities/Agent/AgentLog.cs

42 lines
1.2 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<AgentLogEntity> AgentLog(this IMongoDatabase database) => database.GetCollection<AgentLogEntity>("agent_log");
}
2023-09-22 22:16:56 +02:00
[BsonIgnoreExtraElements]
public class AgentLogEntity
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("_agent"), BsonRepresentation(BsonType.ObjectId), JsonPropertyName("agent")]
public string? Agent { 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("eventid")]
public string? EventId { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("status")]
public string? Status { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("source")]
public string? Source { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("category")]
public string? Category { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("message")]
public string? Message { get; set; }
2023-09-21 18:58:32 +02:00
2023-09-22 22:16:56 +02:00
[BsonElement("timestamp")]
public DateTime? Timestamp { get; set; }
2023-09-21 18:58:32 +02:00
}