feature/service-detection #23

Merged
triggermeelmo merged 4 commits from feature/service-detection into staging 2025-10-03 23:55:47 +02:00
Showing only changes of commit 2169b3d45f - Show all commits

View File

@@ -12,7 +12,7 @@ using Watcher.ViewModels;
namespace Watcher.Controllers; namespace Watcher.Controllers;
public class RegistrationDto public class HardwareDto
{ {
// Server Identity // Server Identity
[Required] [Required]
@@ -101,9 +101,9 @@ public class MonitoringController : Controller
} }
// Endpoint, an dem sich neue Agents registrieren // Endpoint, an den der Agent seine Hardwareinformationen schickt
[HttpPost("register-agent-by-id")] [HttpPost("hardware-info")]
public async Task<IActionResult> Register([FromBody] RegistrationDto dto) public async Task<IActionResult> Register([FromBody] HardwareDto dto)
{ {
// Gültigkeit des Payloads prüfen // Gültigkeit des Payloads prüfen
if (!ModelState.IsValid) if (!ModelState.IsValid)
@@ -140,7 +140,8 @@ public class MonitoringController : Controller
return NotFound("No Matching Server found."); return NotFound("No Matching Server found.");
} }
[HttpGet("server-id-by-ip")] // Endpoint, an dem sich ein Agent initial registriert
[HttpGet("register")]
public async Task<IActionResult> GetServerIdByIp([FromQuery] string IpAddress) public async Task<IActionResult> GetServerIdByIp([FromQuery] string IpAddress)
{ {
var server = await _context.Servers var server = await _context.Servers