Add get deployment by id endpoint

This commit is contained in:
litoral05
2026-05-05 10:53:51 +01:00
parent cdad064717
commit 83c406df8d
@@ -3,6 +3,7 @@ package com.litoralregas.openvpn.deployment;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@RestController
@RequestMapping("/api/deployments")
@@ -21,4 +22,12 @@ public class DeploymentController {
.map(DeploymentResponse::from)
.toList();
}
@GetMapping("/{id}")
public DeploymentResponse getById(@PathVariable UUID id) {
Deployment deployment = repository.findById(id)
.orElseThrow(() -> new IllegalArgumentException("Deployment not found: " + id));
return DeploymentResponse.from(deployment);
}
}