This commit is contained in:
2025-08-21 14:56:35 +05:00
commit ecde1f0eeb
10 changed files with 923 additions and 0 deletions

36
Models/LokiModels.cs Normal file
View File

@ -0,0 +1,36 @@
namespace GetFromLoki.Models;
// Модель для запроса логов
public class LogQueryRequest
{
public Dictionary<string, string> Labels { get; set; } = new();
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }
public int? Limit { get; set; } = 100;
}
// Модель для ответа с логами
public class LogEntry
{
public DateTime Timestamp { get; set; }
public string Message { get; set; } = string.Empty;
}
// Модель ответа Loki API
public class LokiQueryResponse
{
public string Status { get; set; } = string.Empty;
public LokiData Data { get; set; } = new();
}
public class LokiData
{
public string ResultType { get; set; } = string.Empty;
public List<LokiResult> Result { get; set; } = new();
}
public class LokiResult
{
public Dictionary<string, string> Stream { get; set; } = new();
public List<List<string>> Values { get; set; } = new();
}