init
This commit is contained in:
36
Models/LokiModels.cs
Normal file
36
Models/LokiModels.cs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user