Added simple node crud
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MoonlightServers.Shared.Http.Requests.Admin.Nodes;
|
||||
|
||||
public class CreateNodeRequest
|
||||
{
|
||||
[Required(ErrorMessage = "You need to provide a name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to provide a fqdn")]
|
||||
public string Fqdn { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to provide a http port")]
|
||||
[Range(1, 65535, ErrorMessage = "You need to provide a valid http port")]
|
||||
public int HttpPort { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to provide a ftp port")]
|
||||
[Range(1, 65535, ErrorMessage = "You need to provide a valid ftp port")]
|
||||
public int FtpPort { get; set; }
|
||||
|
||||
public bool EnableTransparentMode { get; set; }
|
||||
public bool EnableDynamicFirewall { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MoonlightServers.Shared.Http.Requests.Admin.Nodes;
|
||||
|
||||
public class UpdateNodeRequest
|
||||
{
|
||||
[Required(ErrorMessage = "You need to provide a name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to provide a fqdn")]
|
||||
public string Fqdn { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to provide a http port")]
|
||||
[Range(1, 65535, ErrorMessage = "You need to provide a valid http port")]
|
||||
public int HttpPort { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "You need to provide a ftp port")]
|
||||
[Range(1, 65535, ErrorMessage = "You need to provide a valid ftp port")]
|
||||
public int FtpPort { get; set; }
|
||||
|
||||
public bool EnableTransparentMode { get; set; }
|
||||
public bool EnableDynamicFirewall { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace MoonlightServers.Shared.Http.Responses.Admin.NodeAllocations;
|
||||
|
||||
public class NodeAllocationDetailResponse
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string IpAddress { get; set; }
|
||||
public int Port { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using MoonlightServers.Shared.Http.Responses.Admin.NodeAllocations;
|
||||
|
||||
namespace MoonlightServers.Shared.Http.Responses.Admin.Nodes;
|
||||
|
||||
public class NodeDetailResponse
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
//public List<Server> Servers { get; set; } = new();
|
||||
public NodeAllocationDetailResponse[] Allocations { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Fqdn { get; set; }
|
||||
public string Token { get; set; }
|
||||
public int HttpPort { get; set; }
|
||||
public int FtpPort { get; set; }
|
||||
|
||||
public bool EnableTransparentMode { get; set; }
|
||||
public bool EnableDynamicFirewall { get; set; }
|
||||
}
|
||||
@@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Http\Requests\Admin\NodeAllocations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user