feat(api): Выдача заданий агенту.

This commit is contained in:
Mikhail Trubnikov
2023-10-17 16:59:53 +10:00
parent 26bd0a9a6b
commit a1f19c7ac8
12 changed files with 3126 additions and 2 deletions

View File

@@ -41,6 +41,11 @@
public const string getParam = "{id}";
}
public static class AgentTask
{
public const string GetByIp = Base + "/agent-tasks/ip";
}
//public static class EsppData
//{
// public const string UploadTemplates = Base + "/espp-data/templates";

View File

@@ -0,0 +1,15 @@
namespace PARR.API.Contracts.V1.Requests.Queries
{
public class AgentTaskGetByIpQuery
{
/// <summary>
/// По-умолчанию берётся IP-клиента
/// </summary>
public string? Ip { get; set; }
/// <summary>
/// По-умолчанию расписание на сегодня
/// </summary>
public DateTimeOffset? Date { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
namespace PARR.API.Contracts.V1.Responses
{
public class AgentTaskResponse
{
}
public class AgentTaskMinResponse
{
public List<AgentTaskMinScheduleResponse> Scheduled { get; set; } = new List<AgentTaskMinScheduleResponse>();
}
public class AgentTaskMinScheduleResponse
{
public DateTimeOffset StartAt { get; set; }
public required string Script { get; set; }
public required string Name { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace PARR.API.Contracts.V1.Responses
{
public class TemplateAgentResponse
{
public bool? IsAgent { get; set; }
public string? Name { get; set; }
public string? Script { get; set; }
public int? TimeOutSec { get; set; }
}
}

View File

@@ -16,6 +16,11 @@
public required string Solution { get; set; }
public required string TemplateDuration { get; set; }
public TemplateAgentResponse? Agent { get; set; }
public DateTimeOffset? LastRun { get; set; }
public DateTimeOffset NextRun { get; set; }
public HostResponse? Host { get; set; }