Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 96c481c4c1 |
@@ -108,7 +108,7 @@ public class MonitoringController : Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Endpoint, an den der Agent seine Hardwareinformationen schickt
|
// Endpoint, an den der Agent seine Hardwareinformationen schickt (Registrierung Schritt 2)
|
||||||
[HttpPost("hardware-info")]
|
[HttpPost("hardware-info")]
|
||||||
public async Task<IActionResult> Register([FromBody] HardwareDto dto)
|
public async Task<IActionResult> Register([FromBody] HardwareDto dto)
|
||||||
{
|
{
|
||||||
@@ -151,7 +151,7 @@ public class MonitoringController : Controller
|
|||||||
return NotFound("No Matching Server found.");
|
return NotFound("No Matching Server found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Endpoint, an dem sich ein Agent initial registriert
|
// Endpoint, an dem sich ein Agent seine ID abholt (Registrierung Schritt 1)
|
||||||
[HttpGet("register")]
|
[HttpGet("register")]
|
||||||
public async Task<IActionResult> GetServerIdByIp([FromQuery] string IpAddress)
|
public async Task<IActionResult> GetServerIdByIp([FromQuery] string IpAddress)
|
||||||
{
|
{
|
||||||
@@ -186,8 +186,12 @@ public class MonitoringController : Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Server in Datenbank finden
|
// Server in Datenbank finden
|
||||||
var server = await _context.Servers
|
// DEBUG
|
||||||
.FirstOrDefaultAsync(s => s.Id == dto.ServerId);
|
Console.WriteLine("RECEIVED ID ${ID}", dto.ServerId);
|
||||||
|
Server? server = await _context.Servers.FirstOrDefaultAsync(s => s.Id == dto.ServerId);
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
Console.WriteLine("FOUND SERVER ${ServerName}", server.Name);
|
||||||
|
|
||||||
if (server != null)
|
if (server != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user