Files
get-from-loki/Models/LokiModels.cs
2025-08-21 14:56:35 +05:00

37 lines
969 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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();
}