37 lines
969 B
C#
37 lines
969 B
C#
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();
|
||
}
|